]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Allow events to propagate / default if not used.
authorPete Hopkins <phopkins@twitter.com>
Mon, 30 Jan 2012 17:11:17 +0000 (12:11 -0500)
committerPete Hopkins <phopkins@twitter.com>
Wed, 22 Feb 2012 19:19:55 +0000 (14:19 -0500)
 - All key events when the menu is not shown now propagate.
 - Blur is also allowed to propagate.

js/bootstrap-typeahead.js

index 50315595071b08ed005450abe41f83b922c0fec9..c5776df133744002b77e421345ecdce43866215e 100644 (file)
     }
 
   , keyup: function (e) {
-      e.stopPropagation()
-      e.preventDefault()
-
       switch(e.keyCode) {
         case 40: // down arrow
         case 38: // up arrow
           this.lookup()
       }
 
+      e.stopPropagation()
+      e.preventDefault()
   }
 
   , keypress: function (e) {
-      e.stopPropagation()
       if (!this.shown) return
 
       switch(e.keyCode) {
           this.next()
           break
       }
+
+      e.stopPropagation()
     }
 
   , blur: function (e) {
       var that = this
-      e.stopPropagation()
-      e.preventDefault()
       setTimeout(function () { that.hide() }, 150)
     }