From 852784dd3f887fa615095c4dad8ad46ab05d4aeb Mon Sep 17 00:00:00 2001 From: Igor Vaynberg Date: Fri, 26 Jul 2013 23:57:55 -0700 Subject: [PATCH] fixes #1504 - undo changes made to labels during init --- select2.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/select2.js b/select2.js index 668f7ce5..1bbbd17b 100644 --- a/select2.js +++ b/select2.js @@ -1864,6 +1864,13 @@ the specific language governing permissions and limitations under the Apache Lic this.focusser.focus(); }, + // single + destroy: function() { + $("label[for='" + this.focusser.attr('id') + "']") + .attr('for', this.opts.element.attr("id")); + this.parent.destroy.apply(this, arguments); + }, + // single initContainer: function () { @@ -2404,6 +2411,13 @@ the specific language governing permissions and limitations under the Apache Lic } }, + // multi + destroy: function() { + $("label[for='" + this.search.attr('id') + "']") + .attr('for', this.opts.element.attr("id")); + this.parent.destroy.apply(this, arguments); + }, + // multi initContainer: function () {