aboutsummaryrefslogtreecommitdiffstats
path: root/pages/vomnibar.coffee
diff options
context:
space:
mode:
authorStephen Blott2015-03-05 15:43:11 +0000
committerStephen Blott2015-03-05 15:43:11 +0000
commitbc7a12dc74eaea06bcad23d89fb81643bd8b1625 (patch)
treef10001894e6e191b65d804bb951f42cb3c03951c /pages/vomnibar.coffee
parent8099d5d57f885517c4d5e04cdcc74c91980a75fb (diff)
downloadvimium-bc7a12dc74eaea06bcad23d89fb81643bd8b1625.tar.bz2
Fix various vomnibar clicks...
Click: - in the vomnibar focuses the input - anywhere else (such as in the space below the vomnibar) hides the vomnibar. This makes clicks in the space below the vomnibar behave the same as clicks in the page itself... Which makes sense, because the difference is not apparent to the user.
Diffstat (limited to 'pages/vomnibar.coffee')
-rw-r--r--pages/vomnibar.coffee6
1 files changed, 6 insertions, 0 deletions
diff --git a/pages/vomnibar.coffee b/pages/vomnibar.coffee
index 255dd893..d0b7a7dd 100644
--- a/pages/vomnibar.coffee
+++ b/pages/vomnibar.coffee
@@ -182,6 +182,12 @@ class VomnibarUI
@completionList.style.display = ""
window.addEventListener "focus", => @input.focus()
+ # A click in the vomnibar itself refocuses the input.
+ @box.addEventListener "click", (event) =>
+ @input.focus()
+ event.stopImmediatePropagation()
+ # A click anywhere else hides the vomnibar.
+ document.body.addEventListener "click", => @hide()
#
# Sends filter and refresh requests to a Vomnibox completer on the background page.