From f4886a0afa62d4b2249e2b11c53f427d4a4b9365 Mon Sep 17 00:00:00 2001 From: Marchenko Alexandr Date: Mon, 20 Jan 2014 11:38:33 +0200 Subject: [PATCH 1/2] Optional Search Input Placeholder parameter added --- select2.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/select2.js b/select2.js index 14f6c620..3508062a 100644 --- a/select2.js +++ b/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 = { From 89ae701691f16ca6a83e81ec7c554f42b0c4efc7 Mon Sep 17 00:00:00 2001 From: Marchenko Alexandr Date: Tue, 21 Jan 2014 12:17:58 +0200 Subject: [PATCH 2/2] merge --- select2.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/select2.js b/select2.js index fe79b4f4..ea44e676 100644 --- a/select2.js +++ b/select2.js @@ -2275,7 +2275,7 @@ the specific language governing permissions and limitations under the Apache Lic if (noHighlightUpdate !== false) { if (initial === true && selected >= 0) { // By default, the selected item is displayed inside the result list from a single select - // User can provide an implementation for 'hideSelectionFromResult' and hide it + // User can provide an implementation for 'hideSelectionFromResult' and hide it if(this.opts.hideSelectionFromResult !== undefined && selectedElm !== null) { if(this.opts.hideSelectionFromResult(selectedElm)) selectedElm.addClass("select2-selected"); @@ -3329,11 +3329,8 @@ the specific language governing permissions and limitations under the Apache Lic adaptContainerCssClass: function(c) { return c; }, adaptDropdownCssClass: function(c) { return null; }, nextSearchTerm: function(selectedObject, currentSearchTerm) { return undefined; }, -<<<<<<< HEAD + hideSelectionFromResult: function(selectedObject) { return undefined; }, searchInputPlaceholder: '' -======= - hideSelectionFromResult: function(selectedObject) { return undefined; } ->>>>>>> master }; $.fn.select2.ajaxDefaults = {