diff --git a/src/jquery.multiselect.filter.js b/src/jquery.multiselect.filter.js index 1560700..b1e5f2e 100644 --- a/src/jquery.multiselect.filter.js +++ b/src/jquery.multiselect.filter.js @@ -63,7 +63,7 @@ var _self = this; // do not include hidden elems if the menu isn't open. - var selector = instance._isOpen ? ':disabled, :hidden' : ':disabled'; + var selector = _self._isOpen ? ':disabled, :hidden' : ':disabled'; $inputs = $inputs .not(selector) @@ -91,14 +91,14 @@ }; // rebuild cache when multiselect is updated - var doc = $(document).bind('multiselectrefresh', $.proxy(function() { + var doc = $(document).bind('multiselectrefresh.'+ instance._namespaceID, $.proxy(function() { this.updateCache(); this._handler(); }, this)); // automatically reset the widget on close? if(this.options.autoReset) { - doc.bind('multiselectclose', $.proxy(this._reset, this)); + doc.bind('multiselectclose.'+ instance._namespaceID, $.proxy(this._reset, this)); } }, diff --git a/src/jquery.multiselect.js b/src/jquery.multiselect.js index a1cd9e4..cef6e4e 100644 --- a/src/jquery.multiselect.js +++ b/src/jquery.multiselect.js @@ -417,7 +417,7 @@ // restored to their defaultValue prop on form reset, and the reset // handler fires before the form is actually reset. delaying it a bit // gives the form inputs time to clear. - $(this.element[0].form).bind('reset.multiselect', function() { + $(this.element[0].form).bind('reset.' + this._namespaceID, function() { setTimeout($.proxy(self.refresh, self), 10); }); }, @@ -644,6 +644,7 @@ // unbind events $doc.unbind(this._namespaceID); + $(this.element[0].form).unbind(this._namespaceID); this.button.remove(); this.menu.remove();