Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import ActiveEnzymeTemplate from './templates/activeenzyme.jade';
...
class ActiveEnzymeItemView extends Backbone.View {
static initClass() {
this.prototype.tagName = 'tr';
this.prototype.events = {
click: 'removeEnzyme',
};
}
removeEnzyme() {
return this.model.set('active', false);
}
render() {
const rowHTML = ActiveEnzymeTemplate({name: this.model.name(), color: this.model.color()});
this.$el.html(rowHTML);
return this;
}
}
ActiveEnzymeItemView.initClass();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment