Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'js/tests/unit/bootstrap-typeahead.js')
-rw-r--r--js/tests/unit/bootstrap-typeahead.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/js/tests/unit/bootstrap-typeahead.js b/js/tests/unit/bootstrap-typeahead.js
index 4bdbce9709..0aa2d61b17 100644
--- a/js/tests/unit/bootstrap-typeahead.js
+++ b/js/tests/unit/bootstrap-typeahead.js
@@ -192,17 +192,22 @@ $(function () {
}).appendTo('body')
, typeahead = $input.data('typeahead')
, changed = false
+ , focus = false
+ , blur = false
$input.val('a')
typeahead.lookup()
$input.change(function() { changed = true });
+ $input.focus(function() { focus = true; blur = false });
+ $input.blur(function() { blur = true; focus = false });
$(typeahead.$menu.find('li')[2]).mouseover().click()
equals($input.val(), 'ac', 'input value was correctly set')
ok(!typeahead.$menu.is(':visible'), 'the menu was hidden')
ok(changed, 'a change event was fired')
+ ok(focus && !blur, 'focus is still set')
$input.remove()
typeahead.$menu.remove()