Skip to content

Instantly share code, notes, and snippets.

@alangpierce
Created September 10, 2019 01:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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