diff options
| author | Stephen Blott | 2016-04-19 13:32:39 +0100 |
|---|---|---|
| committer | Stephen Blott | 2016-04-22 14:52:45 +0100 |
| commit | 740df9a23fa9a1e5b812584ce0702b813b226623 (patch) | |
| tree | 18350599c33c8cef17fa4cf8e55b3a9ca0fe0630 /content_scripts | |
| parent | 4a670aaa3d121834685a672acc904f9824721824 (diff) | |
| download | vimium-740df9a23fa9a1e5b812584ce0702b813b226623.tar.bz2 | |
Help dialog; do not offer hints outside of the help dialog.
Diffstat (limited to 'content_scripts')
| -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 702ff69d..6e1ebe80 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 |
