Created
October 2, 2014 12:16
-
-
Save SergeiGolos/6cdbabd5767c414252f7 to your computer and use it in GitHub Desktop.
Implementation of a dispose function for bootstraps typeahead control.
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 (typeahead) { | |
'use strict'; | |
typeahead.prototype.dispose = function () { | |
if (this.eventSupported('keydown')) { | |
this.$element.off('keydown'); | |
} | |
this.$element.off('focus').off('blur').off('keypress').off('keyup'); | |
this.$element = null; | |
this.$menu.off('click').off('mouseenter').off('mouseleave'); | |
this.$menu = null; | |
} | |
})($.fn.typeahead.Constructor) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment