瀏覽代碼

make getPlaceholder() compatible with jquery 1.4

(doesn't check data- attrs when using .data())
Andy Fowler 13 年之前
父節點
當前提交
38b9d060b1
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      select2.js

+ 4 - 1
select2.js

@@ -809,7 +809,10 @@
         },
         },
 
 
         getPlaceholder: function () {
         getPlaceholder: function () {
-            return this.opts.element.attr("placeholder") || this.opts.element.data("placeholder") || this.opts.placeholder;
+            return this.opts.element.attr("placeholder") ||
+                this.opts.element.attr("data-placeholder") || // jquery 1.4 compat
+                this.opts.element.data("placeholder") ||
+                this.opts.placeholder;
         },
         },
 
 
         /**
         /**