diff options
| author | Stephen Blott | 2016-04-26 07:42:03 +0100 |
|---|---|---|
| committer | Stephen Blott | 2016-04-26 07:42:03 +0100 |
| commit | 26667165720a81aee49e959b7bc930b0cd959eb4 (patch) | |
| tree | 83ee1988b0fb8abd2ba5edca34d6737fc4ef7507 /content_scripts/link_hints.coffee | |
| parent | ad9fe3ed81d01e1a164ecc1c0efa21daebdf0276 (diff) | |
| parent | 05b2289ab0bb2278a60d77c5e08b7603e49e014d (diff) | |
| download | vimium-26667165720a81aee49e959b7bc930b0cd959eb4.tar.bz2 | |
Merge pull request #2107 from smblott-github/modernize-help-dialog-styling
Modernize help dialog styling
Diffstat (limited to 'content_scripts/link_hints.coffee')
| -rw-r--r-- | content_scripts/link_hints.coffee | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/content_scripts/link_hints.coffee b/content_scripts/link_hints.coffee index 56a3d75e..0f2425c3 100644 --- a/content_scripts/link_hints.coffee +++ b/content_scripts/link_hints.coffee @@ -70,18 +70,26 @@ HintCoordinator = # place, then Vimium blocks. As a temporary measure, we install a timer to remove it. Utils.setTimeout 1000, -> suppressKeyboardEvents.exit() if suppressKeyboardEvents?.modeIsActive @onExit = [onExit] - @sendMessage "prepareToActivateMode", modeIndex: availableModes.indexOf mode + @sendMessage "prepareToActivateMode", + modeIndex: availableModes.indexOf(mode), isVimiumHelpDialog: window.isVimiumHelpDialog # Hint descriptors are global. They include all of the information necessary for each frame to determine # whether and when a hint from *any* frame is selected. They include the following properties: # frameId: the frame id of this hint's local frame # localIndex: the index in @localHints for the full hint descriptor for this hint # linkText: the link's text for filtered hints (this is null for alphabet hints) - getHintDescriptors: ({modeIndex}) -> + getHintDescriptors: ({modeIndex, isVimiumHelpDialog}) -> # Ensure that the document is ready and that the settings are loaded. DomUtils.documentReady => Settings.onLoaded => requireHref = availableModes[modeIndex] in [COPY_LINK_URL, OPEN_INCOGNITO] - @localHints = LocalHints.getLocalHints requireHref + # If link hints is launched within the help dialog, then we only offer hints from that frame. This + # improves the usability of the help dialog on the options page (particularly for selecting command + # names). + @localHints = + if isVimiumHelpDialog and not window.isVimiumHelpDialog + [] + else + LocalHints.getLocalHints requireHref @localHintDescriptors = @localHints.map ({linkText}, localIndex) -> {frameId, localIndex, linkText} @sendMessage "postHintDescriptors", hintDescriptors: @localHintDescriptors |
