diff options
Diffstat (limited to 'pages/help_dialog.coffee')
| -rw-r--r-- | pages/help_dialog.coffee | 26 | 
1 files changed, 6 insertions, 20 deletions
| diff --git a/pages/help_dialog.coffee b/pages/help_dialog.coffee index 0e4a8973..0300ec00 100644 --- a/pages/help_dialog.coffee +++ b/pages/help_dialog.coffee @@ -6,7 +6,7 @@  #   top-level frame), and then we don't need to be concerned about nested help dialog frames.  HelpDialog =    dialogElement: null -  showing: true +  isShowing: -> true    # This setting is pulled out of local storage. It's false by default.    getShowAdvancedCommands: -> Settings.get("helpDialog_showAdvancedCommands") @@ -30,9 +30,7 @@ HelpDialog =        @hide() unless @dialogElement.contains event.target      , false -  isReady: -> true - -  show: (html) -> +  show: ({html}) ->      for own placeholder, htmlString of html        @dialogElement.querySelector("#help-dialog-#{placeholder}").innerHTML = htmlString @@ -48,15 +46,8 @@ HelpDialog =            chrome.runtime.sendMessage handler: "copyToClipboard", data: commandName            HUD.showForDuration("Yanked #{commandName}.", 2000) -    @exitOnEscape = new Mode name: "help-page-escape", exitOnEscape: true -    @exitOnEscape.onExit (event) => @hide() if event?.type == "keydown" - -  hide: -> -    @exitOnEscape?.exit() -    UIComponentServer.postMessage "hide" - -  toggle: (html) -> -    if @showing then @hide() else @show html +  hide: -> UIComponentServer.hide() +  toggle: (html) -> @hide()    #    # Advanced commands are hidden by default so they don't overwhelm new and casual users. @@ -77,13 +68,8 @@ HelpDialog =  UIComponentServer.registerHandler (event) ->    switch event.data.name ? event.data -    when "frameFocused" -      # 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 +    when "hide" then HelpDialog.hide() +    when "activate"        HelpDialog.init()        HelpDialog.show event.data | 
