1
0
mirror of synced 2025-02-21 06:23:14 +03:00

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

This commit is contained in:
Igor Vaynberg 2012-04-17 08:16:22 -07:00
parent d0caa9131c
commit 5ccee14cee

View File

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