Kaynağa Gözat

fixes #1504 - undo changes made to labels during init

Igor Vaynberg 12 yıl önce
ebeveyn
işleme
852784dd3f
1 değiştirilmiş dosya ile 14 ekleme ve 0 silme
  1. 14 0
      select2.js

+ 14 - 0
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 () {