From bc7a12dc74eaea06bcad23d89fb81643bd8b1625 Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Thu, 5 Mar 2015 15:43:11 +0000 Subject: 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. --- pages/vomnibar.coffee | 6 ++++++ 1 file changed, 6 insertions(+) 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. -- cgit v1.2.3