aboutsummaryrefslogtreecommitdiff
path: root/js/bootstrap-typeahead.js
diff options
context:
space:
mode:
authorPete Hopkins <[email protected]>2012-01-30 12:11:17 -0500
committerPete Hopkins <[email protected]>2012-02-22 14:19:55 -0500
commit80d03e143ce3041e9c3ec63db439ee7738679573 (patch)
tree99102e8c51784a0bad6cae06b031ff1241c32aad /js/bootstrap-typeahead.js
parent8609a77bd2f2b18a88efea5b31d6b6f90036e702 (diff)
downloadbootstrap-80d03e143ce3041e9c3ec63db439ee7738679573.tar.xz
bootstrap-80d03e143ce3041e9c3ec63db439ee7738679573.zip
Allow events to propagate / default if not used.
- All key events when the menu is not shown now propagate. - Blur is also allowed to propagate.
Diffstat (limited to 'js/bootstrap-typeahead.js')
-rw-r--r--js/bootstrap-typeahead.js10
1 files changed, 4 insertions, 6 deletions
diff --git a/js/bootstrap-typeahead.js b/js/bootstrap-typeahead.js
index 503155950..c5776df13 100644
--- a/js/bootstrap-typeahead.js
+++ b/js/bootstrap-typeahead.js
@@ -165,9 +165,6 @@
}
, keyup: function (e) {
- e.stopPropagation()
- e.preventDefault()
-
switch(e.keyCode) {
case 40: // down arrow
case 38: // up arrow
@@ -187,10 +184,11 @@
this.lookup()
}
+ e.stopPropagation()
+ e.preventDefault()
}
, keypress: function (e) {
- e.stopPropagation()
if (!this.shown) return
switch(e.keyCode) {
@@ -210,12 +208,12 @@
this.next()
break
}
+
+ e.stopPropagation()
}
, blur: function (e) {
var that = this
- e.stopPropagation()
- e.preventDefault()
setTimeout(function () { that.hide() }, 150)
}