diff options
| author | Stephen Blott | 2016-03-27 12:35:36 +0100 |
|---|---|---|
| committer | Stephen Blott | 2016-03-27 12:35:36 +0100 |
| commit | 3539ad89382c02bf2f89d890b86e49409059391f (patch) | |
| tree | dab8c34b92ab3a546130ed45bd0548cb217facde /pages | |
| parent | 9c96f750f7c2d22eb0098dcb05b34c51c802e8ac (diff) | |
| download | vimium-3539ad89382c02bf2f89d890b86e49409059391f.tar.bz2 | |
Finally fix help-dialog focus issue.
In the previous commits, I omitted to actually check that the help
dialog wasn't closing on the options page.
I should be good now.
Diffstat (limited to 'pages')
| -rw-r--r-- | pages/help_dialog.coffee | 14 |
1 files changed, 4 insertions, 10 deletions
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 |
