Skip to content

Instantly share code, notes, and snippets.

@alangpierce
Created September 10, 2019 01:25
Show Gist options
  • Save alangpierce/e84c56217320156b013e1ac5e89591e7 to your computer and use it in GitHub Desktop.
Save alangpierce/e84c56217320156b013e1ac5e89591e7 to your computer and use it in GitHub Desktop.
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