Created
September 10, 2019 01:25
-
-
Save alangpierce/e84c56217320156b013e1ac5e89591e7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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