Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Selector Function Extension
$.Controller("Comment",
{
defaultOptions: {
"{comment}": "[data-comment]"
}
},
function(self) { return {
comment: {
remove: function(id) {
// Remove comment
self.comment()
.where("id", id)
.remove();
// Trigger commentRemove
self.trigger("commentRemove", [id]);
}
},
"{deleteButton} click": function(deleteButton) {
var id = self.comment.of(deleteButton).data("id");
self.comment.remove(id);
}
}};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.