Created
July 3, 2014 07:52
-
-
Save allenfantasy/cb5b4fc0afed049141d8 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
function _setListeners() { | |
this.heartSurface.on('click', this.clickListener.bind(this)); | |
} | |
function HeartView() { | |
View.apply(this, arguments); | |
_createHeart.call(this); // create HeartSurface | |
_setListeners.call(this); | |
} | |
HeartView.prototype = Object.create(View.prototype); | |
HeartView.prototype.constructor = HeartView; | |
HeartView.prototype.clickListener = function() { | |
this._eventOutput.emit('sayThanks'); | |
this._eventOutput.emit('updateCounter'); | |
}; | |
HeartView.prototype.removeClickListener = function() { | |
this.heartSurface.removeListener('click', this.clickListener.bind(this)); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment