From 1b1b9c25e8b234598ff110dce7bb150f6d886169 Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Sun, 25 Sep 2016 16:09:17 +0100 Subject: Make tab-selected hint visible. When the user selects an active hint with Tab (for filtered hints), adjust its z-index such at it is top of the stack. --- content_scripts/link_hints.coffee | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/content_scripts/link_hints.coffee b/content_scripts/link_hints.coffee index 69ef79c1..4ae8c459 100644 --- a/content_scripts/link_hints.coffee +++ b/content_scripts/link_hints.coffee @@ -312,7 +312,7 @@ class LinkHintsMode updateKeyState: ({hintKeystrokeQueue, linkTextKeystrokeQueue, tabCount}) -> extend @markerMatcher, {hintKeystrokeQueue, linkTextKeystrokeQueue} - {linksMatched, userMightOverType} = @markerMatcher.getMatchingHints @hintMarkers, tabCount + {linksMatched, userMightOverType} = @markerMatcher.getMatchingHints @hintMarkers, tabCount, this.getNextZIndex.bind this if linksMatched.length == 0 @deactivateMode() else if linksMatched.length == 1 @@ -513,7 +513,7 @@ class FilterHints # strings. This ensures that we always get hint strings in the same order. @filterLinkHints hintMarkers - getMatchingHints: (hintMarkers, tabCount = 0) -> + getMatchingHints: (hintMarkers, tabCount, getNextZIndex) -> # At this point, linkTextKeystrokeQueue and hintKeystrokeQueue have been updated to reflect the latest # input. Use them to filter the link hints accordingly. matchString = @hintKeystrokeQueue.join "" @@ -526,6 +526,7 @@ class FilterHints @activeHintMarker?.classList?.remove "vimiumActiveHintMarker" @activeHintMarker = linksMatched[tabCount] @activeHintMarker?.classList?.add "vimiumActiveHintMarker" + @activeHintMarker.style.zIndex = getNextZIndex() linksMatched: linksMatched userMightOverType: @hintKeystrokeQueue.length == 0 and 0 < @linkTextKeystrokeQueue.length -- cgit v1.2.3