diff options
| author | Stephen Blott | 2016-04-17 11:57:16 +0100 |
|---|---|---|
| committer | Stephen Blott | 2016-04-17 11:57:16 +0100 |
| commit | cefbb461a3b564845a61893fcbe5faa0084c6f4c (patch) | |
| tree | 38743486ac59f76462d6d6da9c8c90038c467834 /pages/vomnibar.coffee | |
| parent | 014f53fb091ac8672d3efbeca13a494c15d8afcb (diff) | |
| parent | 5c3e4bda2968486e23f8cc3410e776de67fec849 (diff) | |
| download | vimium-cefbb461a3b564845a61893fcbe5faa0084c6f4c.tar.bz2 | |
Merge pull request #2100 from smblott-github/rework-ui-component-focus-handling
Rework ui component focus handling
Diffstat (limited to 'pages/vomnibar.coffee')
| -rw-r--r-- | pages/vomnibar.coffee | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/pages/vomnibar.coffee b/pages/vomnibar.coffee index 0332b12f..449c0bac 100644 --- a/pages/vomnibar.coffee +++ b/pages/vomnibar.coffee @@ -38,7 +38,7 @@ Vomnibar = class VomnibarUI constructor: -> @refreshInterval = 0 - @postHideCallback = null + @onHiddenCallback = null @initDom() setQuery: (query) -> @input.value = query @@ -56,14 +56,14 @@ class VomnibarUI # 3. Only once the "hidden" message is received here is any required action invoked (in onHidden). # This ensures that the vomnibar is actually hidden before any new tab is created, and avoids flicker after # opening a link in a new tab then returning to the original tab (see #1485). - hide: (@postHideCallback = null) -> + hide: (@onHiddenCallback = null) -> UIComponentServer.postMessage "hide" @reset() - @completer?.reset() onHidden: -> - @postHideCallback?() - @postHideCallback = null + @onHiddenCallback?() + @onHiddenCallback = null + @reset() reset: -> @clearUpdateTimer() @@ -75,6 +75,7 @@ class VomnibarUI @selection = @initialSelectionValue @keywords = [] @seenTabToOpenCompletionList = false + @completer?.reset() updateSelection: -> # For custom search engines, we suppress the leading term (e.g. the "w" of "w query terms") within the @@ -331,10 +332,9 @@ class BackgroundCompleter UIComponentServer.registerHandler (event) -> switch event.data.name ? event.data - when "frameFocused" then Vomnibar.hide() when "hide" then Vomnibar.hide() when "hidden" then Vomnibar.onHidden() - else Vomnibar.activate event.data + when "activate" then Vomnibar.activate event.data root = exports ? window root.Vomnibar = Vomnibar |
