Skip to content

Instantly share code, notes, and snippets.

@bmaland
Created October 8, 2012 20:27
Show Gist options
  • Save bmaland/3854769 to your computer and use it in GitHub Desktop.
Save bmaland/3854769 to your computer and use it in GitHub Desktop.
var CdView = Backbone.View.extend({
tagName: "li",
initialize: function() {
this.model.on("change" this.render);
},
events: {
"click .icon": "open",
"click .button.delete": "destroy"
},
render: function() {
this.$el.html("<img src='" + this.model.get("imageUrl") + "' />");
return this;
},
open: function() {
// open a detailed view
},
destroy: function() {
// destroy the cd
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment