diff options
| author | mrmr1993 | 2017-11-11 16:51:47 +0000 |
|---|---|---|
| committer | mrmr1993 | 2017-11-20 19:42:23 +0000 |
| commit | 4f5667c427a1d14fc8c6eb3477eb58c69b467bf9 (patch) | |
| tree | 0dbde85070c48a7a26557e321208cd6883414a70 /content_scripts | |
| parent | 48e556d2ea209c22485ee07710dbac2f32fe481f (diff) | |
| download | vimium-4f5667c427a1d14fc8c6eb3477eb58c69b467bf9.tar.bz2 | |
Unify link hint flash codepaths
Diffstat (limited to 'content_scripts')
| -rw-r--r-- | content_scripts/link_hints.coffee | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/content_scripts/link_hints.coffee b/content_scripts/link_hints.coffee index e3e96ffe..d919dae1 100644 --- a/content_scripts/link_hints.coffee +++ b/content_scripts/link_hints.coffee @@ -385,15 +385,15 @@ class LinkHintsMode clickEl.focus() linkActivator clickEl + if linkMatched.isLocalMarker + {top: viewportTop, left: viewportLeft} = DomUtils.getViewportTopLeft() + for rect in clickEl.getClientRects() + flashEl = DomUtils.addFlashRect Rect.translate rect, viewportLeft, viewportTop + do (flashEl) -> HintCoordinator.onExit.push -> DomUtils.removeElement flashEl + # If we're using a keyboard blocker, then the frame with the focus sends the "exit" message, otherwise the # frame containing the matched link does. if userMightOverType - if linkMatched.isLocalMarker - {top: viewportTop, left: viewportLeft} = DomUtils.getViewportTopLeft() - for rect in clickEl.getClientRects() - flashEl = DomUtils.addFlashRect Rect.translate rect, viewportLeft, viewportTop - do (flashEl) -> HintCoordinator.onExit.push -> DomUtils.removeElement flashEl - if windowIsFocused() callback = (isSuccess) -> HintCoordinator.sendMessage "exit", {isSuccess} if Settings.get "waitForEnterForFilteredHints" @@ -401,7 +401,6 @@ class LinkHintsMode else new TypingProtector 200, callback else if linkMatched.isLocalMarker - DomUtils.flashRect linkMatched.rect HintCoordinator.sendMessage "exit", isSuccess: true # |
