Преглед изворни кода

Check for nonexistent data attribute in a way that works in jQuery 1.4.2

Geoffrey Hing пре 13 година
родитељ
комит
6dcb276485
1 измењених фајлова са 2 додато и 1 уклоњено
  1. 2 1
      select2.js

+ 2 - 1
select2.js

@@ -352,7 +352,8 @@
             this.id=opts.id;
 
             // destroy if called on an existing component
-            if (opts.element.data("select2") !== undefined) {
+            if (opts.element.data("select2") !== undefined &&
+                opts.element.data("select2") !== null) {
                 this.destroy();
             }