Skip to content

Instantly share code, notes, and snippets.

@alonecuzzo
Created December 14, 2012 15:52
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 alonecuzzo/4286396 to your computer and use it in GitHub Desktop.
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.
//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