diff options
| author | Stephen Blott | 2016-04-17 10:18:08 +0100 | 
|---|---|---|
| committer | Stephen Blott | 2016-04-17 10:18:10 +0100 | 
| commit | 025b7f930205e9dfbae5f2dff5c7c1fd4a45e4c1 (patch) | |
| tree | e420642cfc913549984ece51ccda566ca1f8bc66 | |
| parent | e07a252508eea45c4dcadc92cdad02d42df2f5f8 (diff) | |
| download | vimium-025b7f930205e9dfbae5f2dff5c7c1fd4a45e4c1.tar.bz2 | |
Use register/unregister frame in help dialog.
Remove special-purpose code from `gf`.
Instead, register the help dialog frame when it launches, and unregister
it when it's hidden.
This way, when the helpd-dialog frame is hidden, it simply isn't
available for `gf` and for link hints.
| -rw-r--r-- | content_scripts/vimium_frontend.coffee | 1 | ||||
| -rw-r--r-- | pages/help_dialog.coffee | 9 | 
2 files changed, 5 insertions, 5 deletions
| diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee index 986fd322..3c429115 100644 --- a/content_scripts/vimium_frontend.coffee +++ b/content_scripts/vimium_frontend.coffee @@ -293,7 +293,6 @@ focusThisFrame = (request) ->    unless request.forceFocusThisFrame      skipThisFrame = DomUtils.windowIsTooSmall() # Frame is too small; see #1317.      skipThisFrame ||= document.body?.tagName.toLowerCase() == "frameset" -    skipThisFrame ||= window.isVimiumUIComponent and not HelpDialog.showing      if skipThisFrame        # Cancel and tell the background page to focus the next frame instead.        chrome.runtime.sendMessage handler: "nextFrame" diff --git a/pages/help_dialog.coffee b/pages/help_dialog.coffee index 2ea4353c..111ef73e 100644 --- a/pages/help_dialog.coffee +++ b/pages/help_dialog.coffee @@ -6,8 +6,7 @@  #   top-level frame), and then we don't need to be concerned about nested help dialog frames.  HelpDialog =    dialogElement: null -  showing: false -  isShowing: -> @showing +  isShowing: -> true    # This setting is pulled out of local storage. It's false by default.    getShowAdvancedCommands: -> Settings.get("helpDialog_showAdvancedCommands") @@ -70,11 +69,13 @@ HelpDialog =  UIComponentServer.registerHandler (event) ->    switch event.data.name ? event.data      when "hide" then HelpDialog.hide() -    when "hidden" then HelpDialog.showing = false      when "activate"        HelpDialog.init() -      HelpDialog.showing = true        HelpDialog.show event.data +      Frame.postMessage "registerFrame" +    when "hidden" +      # Unregister the frame, so that it's not available for `gf` or linkk hints. +      Frame.postMessage "unregisterFrame"  root = exports ? window  root.HelpDialog = HelpDialog | 
