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:
authorPete Hopkins <phopkins@twitter.com>2012-01-30 21:13:18 +0400
committerPete Hopkins <phopkins@twitter.com>2012-02-22 23:19:55 +0400
commit70fecd111566eec3136457afb4143d0950c455b5 (patch)
treed6422f27c3418d61d14acf02e184eb76dbecd89e /js/tests/unit/bootstrap-typeahead.js
parent80d03e143ce3041e9c3ec63db439ee7738679573 (diff)
Fires change event when element is selected from menu
Diffstat (limited to 'js/tests/unit/bootstrap-typeahead.js')
-rw-r--r--js/tests/unit/bootstrap-typeahead.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/js/tests/unit/bootstrap-typeahead.js b/js/tests/unit/bootstrap-typeahead.js
index 455ed415b7..96ea7c45fc 100644
--- a/js/tests/unit/bootstrap-typeahead.js
+++ b/js/tests/unit/bootstrap-typeahead.js
@@ -114,15 +114,19 @@ $(function () {
source: ['aa', 'ab', 'ac']
})
, typeahead = $input.data('typeahead')
+ , changed = false
$input.val('a')
typeahead.lookup()
+ $input.change(function() { changed = true });
+
$(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')
typeahead.$menu.remove()
})
-}) \ No newline at end of file
+})