Ver código fonte

Optional Search Input Placeholder parameter added

Marchenko Alexandr 11 anos atrás
pai
commit
f4886a0afa
1 arquivos alterados com 3 adições e 1 exclusões
  1. 3 1
      select2.js

+ 3 - 1
select2.js

@@ -799,6 +799,7 @@ the specific language governing permissions and limitations under the Apache Lic
             opts.element.prop("autofocus", false);
             if (this.autofocus) this.focus();
 
+            this.search.attr("placeholder", opts.searchInputPlaceholder);
         },
 
         // abstract
@@ -3313,7 +3314,8 @@ the specific language governing permissions and limitations under the Apache Lic
         selectOnBlur: false,
         adaptContainerCssClass: function(c) { return c; },
         adaptDropdownCssClass: function(c) { return null; },
-        nextSearchTerm: function(selectedObject, currentSearchTerm) { return undefined; }
+        nextSearchTerm: function(selectedObject, currentSearchTerm) { return undefined; },
+        searchInputPlaceholder: ''
     };
 
     $.fn.select2.ajaxDefaults = {