diff options
| author | Stephen Blott | 2016-04-03 08:32:42 +0100 |
|---|---|---|
| committer | Stephen Blott | 2016-04-04 06:15:51 +0100 |
| commit | f8f29c0ea1801be68cec47fa86861afab9cc9055 (patch) | |
| tree | 6ce30c1a4782afd4c5f6d2e43e57ff8a4349f950 | |
| parent | 4cbeb44d7ae33e6bfeb221b47b63eac6b727ef8d (diff) | |
| download | vimium-f8f29c0ea1801be68cec47fa86861afab9cc9055.tar.bz2 | |
Keep reason local for link hints.
The "reason" a hint is available is only ever needed in the hint's own
frame, so there's no need to pass it to other frames.
| -rw-r--r-- | content_scripts/link_hints.coffee | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/content_scripts/link_hints.coffee b/content_scripts/link_hints.coffee index c3a4046b..4229d549 100644 --- a/content_scripts/link_hints.coffee +++ b/content_scripts/link_hints.coffee @@ -79,8 +79,8 @@ HintCoordinator = @localHints = LocalHints.getLocalHints() console.log "getHintDescriptors", frameId, "[#{@localHints.length}]" if @debug @sendMessage "postHintDescriptors", hintDescriptors: - @localHints.map ({linkText, showLinkText, hasHref, reason}, localIndex) -> - {linkText, showLinkText, hasHref, reason, frameId, localIndex} + @localHints.map ({linkText, showLinkText, hasHref}, localIndex) -> + {linkText, showLinkText, hasHref, frameId, localIndex} # We activate LinkHintsMode() in every frame and provide every frame with exactly the same hint descriptors. # We also propagate the key state between frames. Therefore, the hint-selection process proceeds in lock @@ -295,14 +295,15 @@ class LinkHintsMode # selectively pushing the appropriate HintCoordinator.onExit handlers. activateLink: (linkMatched, userMightOverType=false) -> @removeHintMarkers() - clickEl = HintCoordinator.getLocalHintMarker(linkMatched.hintDescriptor)?.element + localHintDescriptor = HintCoordinator.getLocalHintMarker linkMatched.hintDescriptor + clickEl = localHintDescriptor?.element if clickEl? HintCoordinator.onExit.push (isSuccess) => if isSuccess - if linkMatched.hintDescriptor.reason == "Frame." + if localHintDescriptor.reason == "Frame." Utils.nextTick -> focusThisFrame highlight: true - else if linkMatched.hintDescriptor.reason == "Scroll." + else if localHintDescriptor.reason == "Scroll." # Tell the scroller that this is the activated element. handlerStack.bubbleEvent "DOMActivate", target: clickEl else if DomUtils.isSelectable clickEl |
