Created
May 10, 2013 16:43
-
-
Save qbunt/5555646 to your computer and use it in GitHub Desktop.
Helps in killing of zombies.
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
destroyView = function (view) { | |
// completely unbind and destroy the view | |
view.undelegateEvents(); | |
view.$el.removeData().unbind(); | |
//Remove view from DOM | |
view.remove(); | |
Backbone.View.prototype.remove.call(view); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment