1
0
mirror of synced 2024-11-29 16:16:02 +03:00

Update select2.js

fixed destroy
This commit is contained in:
Vitaliy Ryaboy 2014-06-17 13:47:31 +02:00
parent 0d9893936c
commit 78526a3860

View File

@ -836,13 +836,13 @@ the specific language governing permissions and limitations under the Apache Lic
// abstract // abstract
destroy: function () { destroy: function () {
var element=this.opts.element, select2 = element.data("select2"); var element=this.opts.element, select2 = element.data("select2"), self = this;
this.close(); this.close();
if (element.length && element[0].detachEvent) { if (element.length && element[0].detachEvent) {
element.each(function () { element.each(function () {
this.detachEvent("onpropertychange", this._sync); this.detachEvent("onpropertychange", self._sync);
}); });
} }
if (this.propertyObserver) { if (this.propertyObserver) {