Created
December 14, 2012 15:52
-
-
Save alonecuzzo/4286396 to your computer and use it in GitHub Desktop.
This can be used to delete a specific event from a Backbone View. It basically solves the issue of not being able to specify an even to undelegate.
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
//from inside the view | |
undelegateEvent: function(event) { | |
this.undelegateEvents(); | |
var events = _.clone(this.events); | |
delete events.event; | |
this.delegateEvents(events); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment