Skip to content

Commit

Permalink
Merge pull request loopj#308 from leonkenneth/focus-state
Browse files Browse the repository at this point in the history
Added `token-input-focused` CSS class to mimic focused state.
  • Loading branch information
loopj committed Apr 23, 2012
2 parents 985d095 + 40eb484 commit 73cf684
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/jquery.tokeninput.js
Expand Up @@ -66,6 +66,7 @@ var DEFAULT_CLASSES = {
dropdownItem2: "token-input-dropdown-item2",
selectedDropdownItem: "token-input-selected-dropdown-item",
inputToken: "token-input-input-token",
focused: "token-input-focused",
disabled: "token-input-disabled"
};

Expand Down Expand Up @@ -203,10 +204,12 @@ $.TokenList = function (input, url_or_data, settings) {
if (settings.tokenLimit === null || settings.tokenLimit !== token_count) {
show_dropdown_hint();
}
token_list.addClass(settings.classes.focused);
})
.blur(function () {
hide_dropdown();
$(this).val("");
token_list.removeClass(settings.classes.focused);
})
.bind("keyup keydown blur update", resize_input)
.keydown(function (event) {
Expand Down

0 comments on commit 73cf684

Please sign in to comment.