Преглед на файлове

Update select2.js

fixed destroy
Vitaliy Ryaboy преди 11 години
родител
ревизия
78526a3860
променени са 1 файла, в които са добавени 2 реда и са изтрити 2 реда
  1. 2 2
      select2.js

+ 2 - 2
select2.js

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