diff options
| -rw-r--r-- | content_scripts/ui_component.coffee | 2 | ||||
| -rw-r--r-- | pages/help_dialog.coffee | 14 |
2 files changed, 5 insertions, 11 deletions
diff --git a/content_scripts/ui_component.coffee b/content_scripts/ui_component.coffee index ac0bea71..4c9b18e1 100644 --- a/content_scripts/ui_component.coffee +++ b/content_scripts/ui_component.coffee @@ -76,7 +76,7 @@ class UIComponent if event.target == window window.removeEventListener "focus", @onFocus @onFocus = null - @postMessage "hide" + @postMessage "frameFocused" @showing = true hide: (focusWindow = true)-> diff --git a/pages/help_dialog.coffee b/pages/help_dialog.coffee index f12b19a3..0e4a8973 100644 --- a/pages/help_dialog.coffee +++ b/pages/help_dialog.coffee @@ -27,19 +27,11 @@ HelpDialog = HelpDialog.toggleAdvancedCommands, false) document.documentElement.addEventListener "click", (event) => - # Normally, we hide the help dialog on "click". On the options page though, we do not. This allows the - # user to view the help page while typing command names into the key mappings input; see #2045. - @hide() unless @isVimiumOptionsPage() or @dialogElement.contains event.target + @hide() unless @dialogElement.contains event.target , false isReady: -> true - isVimiumOptionsPage: -> - try - window.top.isVimiumOptionsPage - catch - false - show: (html) -> for own placeholder, htmlString of html @dialogElement.querySelector("#help-dialog-#{placeholder}").innerHTML = htmlString @@ -86,7 +78,9 @@ HelpDialog = UIComponentServer.registerHandler (event) -> switch event.data.name ? event.data when "frameFocused" - HelpDialog.hide() unless event.data.focusFrameId == frameId + # We normally close when we lose the focus. However, we do not close on the options page. This allows + # users to view the help dialog while typing in the key-mappings input. + HelpDialog.hide() unless event.data.focusFrameId == frameId or try window.top.isVimiumOptionsPage when "hide" HelpDialog.hide() else |
