Skip to content

Commit

Permalink
placeholder for search input
Browse files Browse the repository at this point in the history
  • Loading branch information
janikoskela committed Feb 28, 2015
1 parent 016c8dd commit 8566486
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ optionMenuWidth|String|-|Determines the width of option menu. Overrides the widt
closeWhenCursorOut|Boolean|True|Determines if option menu will be closed when cursor leaves select box
loadingText|String|"Loading"|The text which is used in loading mode
useSearchInput|boolean|false|Renders search input if true
searchInputPlaceholder|String|""|Sets search inputs placeholder text
noResultsMessage|String|"No results"|No results message
usePolling|Boolean|false|Given <i>select</i> is polled to monitor its changes. See <a href="#monitoring">Monitoring</a> below
pollingInterval|Integer|100|polling interval speed in ms
Expand Down
3 changes: 3 additions & 0 deletions src/dist/select.js
Original file line number Diff line number Diff line change
Expand Up @@ -1101,16 +1101,19 @@ SELECT.ELEMENTS.WIDGET.OPTIONS_MENU.OptionsMenuListItemGroupList.prototype = Obj
};

SELECT.ELEMENTS.WIDGET.OPTIONS_MENU.OptionsMenuListItemGroupTitle.prototype = Object.create(SELECT.ELEMENTS.Element.prototype);SELECT.ELEMENTS.WIDGET.OPTIONS_MENU.OptionsMenuSearchInput = function(Facade) {
var userDefinedSettings = Facade.publish("UserDefinedSettings");
this.type = "input";
this.className = "options-menu-search-input";
this.tabIndex = -1;
this.element;
this.allowClose = true;
this.placeholder = userDefinedSettings.searchInputPlaceholder || "";

this.render = function() {
this.element = SELECT.UTILS.createElement(this.type, this.className);
this.element.setAttribute("type", "text");
this.element.setAttribute("tabindex", this.tabIndex);
this.element.setAttribute("placeholder", this.placeholder);
this.element.addEventListener("blur", this.focusOut);
this.element.addEventListener("keyup", onKeyUp.bind(this));
return this.element;
Expand Down
4 changes: 2 additions & 2 deletions src/dist/select.min.js

Large diffs are not rendered by default.

Binary file modified src/dist/select.min.js.gz
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
SELECT.ELEMENTS.WIDGET.OPTIONS_MENU.OptionsMenuSearchInput = function(Facade) {
var userDefinedSettings = Facade.publish("UserDefinedSettings");
this.type = "input";
this.className = "options-menu-search-input";
this.tabIndex = -1;
this.element;
this.allowClose = true;
this.placeholder = userDefinedSettings.searchInputPlaceholder || "";

this.render = function() {
this.element = SELECT.UTILS.createElement(this.type, this.className);
this.element.setAttribute("type", "text");
this.element.setAttribute("tabindex", this.tabIndex);
this.element.setAttribute("placeholder", this.placeholder);
this.element.addEventListener("blur", this.focusOut);
this.element.addEventListener("keyup", onKeyUp.bind(this));
return this.element;
Expand Down

0 comments on commit 8566486

Please sign in to comment.