aboutsummaryrefslogtreecommitdiffstats
path: root/content_scripts
diff options
context:
space:
mode:
authormrmr19932015-09-11 12:20:41 +0100
committermrmr19932016-01-30 13:11:46 +0000
commit07e2bd2fbb0e404af1bb5dfabef94299565171bd (patch)
tree7897e9434ef4068f764bc89ca34d4cb00fd90bcc /content_scripts
parentc3373252db73430ec466eb0b81a16a5953975e19 (diff)
downloadvimium-07e2bd2fbb0e404af1bb5dfabef94299565171bd.tar.bz2
Emit mouseout when clicking a new element link hints
Diffstat (limited to 'content_scripts')
-rw-r--r--content_scripts/link_hints.coffee12
1 files changed, 11 insertions, 1 deletions
diff --git a/content_scripts/link_hints.coffee b/content_scripts/link_hints.coffee
index 07deaf61..fad6b839 100644
--- a/content_scripts/link_hints.coffee
+++ b/content_scripts/link_hints.coffee
@@ -93,6 +93,7 @@ class LinkHintsMode
else
@hintMode.setIndicator "Open multiple links in new tabs."
@linkActivator = (link) ->
+ @unhoverLast link
# When "clicking" on a link, dispatch the event with the appropriate meta key (CMD on Mac, CTRL on
# windows) to open it in a new tab if necessary.
DomUtils.simulateClick link,
@@ -117,10 +118,13 @@ class LinkHintsMode
else if @mode is DOWNLOAD_LINK_URL
@hintMode.setIndicator "Download link URL."
@linkActivator = (link) ->
+ @unhoverLast link
DomUtils.simulateClick link, altKey: true, ctrlKey: false, metaKey: false
else # OPEN_IN_CURRENT_TAB
@hintMode.setIndicator "Open link in current tab."
- @linkActivator = (link) -> DomUtils.simulateClick.bind(DomUtils, link)()
+ @linkActivator = (link) ->
+ @unhoverLast link
+ DomUtils.simulateClick link
#
# Creates a link marker for the given link.
@@ -377,6 +381,12 @@ class LinkHintsMode
else
@deactivateMode delay
+ unhoverLast: do ->
+ lastHoveredElement = null
+ (element) ->
+ DomUtils.simulateUnhover lastHoveredElement if lastHoveredElement?
+ lastHoveredElement = element
+
#
# Shows the marker, highlighting matchingCharCount characters.
#