Sfoglia il codice sorgente

remove event bindings on destroy. closes #35 closes #36

Igor Vaynberg 13 anni fa
parent
commit
5ccee14cee
1 ha cambiato i file con 2 aggiunte e 1 eliminazioni
  1. 2 1
      select2.js

+ 2 - 1
select2.js

@@ -419,6 +419,7 @@
                 select2.container.remove();
                 select2.opts.element
                     .removeData("select2")
+                    .unbind(".select2")
                     .show();
             }
         },
@@ -503,7 +504,7 @@
          * Monitor the original element for changes and update select2 accordingly
          */
         monitorSource: function () {
-            this.opts.element.bind("change", this.bind(function (e) {
+            this.opts.element.bind("change.select2", this.bind(function (e) {
                 if (this.opts.element.data("select2-change-triggered") !== true) {
                     this.initSelection();
                 }