aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Blott2016-03-27 07:40:41 +0100
committerStephen Blott2016-03-27 07:40:46 +0100
commit61f207c12a1617132115ce28e3f0262fffe187f4 (patch)
tree69fb73e8993aaca43393250f0b3b1bdaa6690b9b
parent11ade4ed2dae1b6f873d5c33e533f39a03838adf (diff)
downloadvimium-61f207c12a1617132115ce28e3f0262fffe187f4.tar.bz2
Do not hide help dialog on click (on options page).
Normally, we close the help dialog when the user clicks outside of it. On the options page, however, the user might want the help dialog open while they type command names into the key-mappings input. Therefore, we disable hide-on-click for this specific use case. This is a rather unfortunate hack. However, #2045 is a serious problem for an important use case. Fixes #2045.
-rw-r--r--pages/help_dialog.coffee10
-rw-r--r--pages/options.coffee2
2 files changed, 10 insertions, 2 deletions
diff --git a/pages/help_dialog.coffee b/pages/help_dialog.coffee
index e16fd5d3..997ea915 100644
--- a/pages/help_dialog.coffee
+++ b/pages/help_dialog.coffee
@@ -27,11 +27,19 @@ HelpDialog =
HelpDialog.toggleAdvancedCommands, false)
document.documentElement.addEventListener "click", (event) =>
- @hide() unless @dialogElement.contains event.target
+ # 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
, 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
diff --git a/pages/options.coffee b/pages/options.coffee
index 6070400e..c708efa7 100644
--- a/pages/options.coffee
+++ b/pages/options.coffee
@@ -322,4 +322,4 @@ document.addEventListener "DOMContentLoaded", ->
# Exported for tests.
root = exports ? window
-root.Options = Options
+extend root, {Options, isVimiumOptionsPage: true}