From 3c988a07a64a5bf4cab9ec98fe4d377c2af2208e Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Fri, 6 Mar 2015 13:45:36 +0000 Subject: Remove need for short delay to prevent vomnibar flicker. This delivers a "hidden" massage to the vomnibar after the vomnibar has been hiddent in the host page. The vomnibar only performs whatever action is required when it receives this "hidden" message. --- content_scripts/ui_component.coffee | 2 +- content_scripts/vomnibar.coffee | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'content_scripts') diff --git a/content_scripts/ui_component.coffee b/content_scripts/ui_component.coffee index c6b59464..47ff995e 100644 --- a/content_scripts/ui_component.coffee +++ b/content_scripts/ui_component.coffee @@ -46,7 +46,7 @@ class UIComponent hide: (focusWindow = true)-> @iframeElement.classList.remove "vimiumUIComponentShowing" @iframeElement.classList.add "vimiumUIComponentHidden" - window.removeEventListener @onFocus if @onFocus + window.removeEventListener "focus", @onFocus if @onFocus @onFocus = null window.focus() if focusWindow @showing = false diff --git a/content_scripts/vomnibar.coffee b/content_scripts/vomnibar.coffee index 6381fd7f..c4cfc8b9 100644 --- a/content_scripts/vomnibar.coffee +++ b/content_scripts/vomnibar.coffee @@ -38,7 +38,10 @@ Vomnibar = init: -> unless @vomnibarUI? @vomnibarUI = new UIComponent "pages/vomnibar.html", "vomnibarFrame", (event) => - @vomnibarUI.hide() if event.data == "hide" + if event.data == "hide" + @vomnibarUI.hide() + @vomnibarUI.postMessage "hidden" + # This function opens the vomnibar. It accepts options, a map with the values: # completer - The completer to fetch results from. -- cgit v1.2.3