diff options
| author | Stephen Blott | 2016-03-12 12:53:03 +0000 |
|---|---|---|
| committer | Stephen Blott | 2016-03-28 05:44:54 +0100 |
| commit | 52ce015c04b22ae8c519fcd5b420788f8825c800 (patch) | |
| tree | 9cf50f307ca857314f8177e712680451c0d15bbd | |
| parent | c8414d92886c7705dc0892cdedf3939f75336889 (diff) | |
| download | vimium-52ce015c04b22ae8c519fcd5b420788f8825c800.tar.bz2 | |
Global link hints; fix focus issue for options page.
Here's the issue (and we may have to address this ouside of this PR).
If we put the HUD in the top frame, then the top frame grabs the focus
when the HUD is displayed.
If we open link hints with the help dialog open, then the help dialog
loses the focus, and we can't `Esc` out of it.
| -rw-r--r-- | content_scripts/link_hints.coffee | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/content_scripts/link_hints.coffee b/content_scripts/link_hints.coffee index e695e869..36ab1c97 100644 --- a/content_scripts/link_hints.coffee +++ b/content_scripts/link_hints.coffee @@ -71,7 +71,7 @@ HintCoordinator = postKeyState: (request) -> @linkHintsMode.postKeyState request activateActiveHintMarker: -> @linkHintsMode.activateLink @linkHintsMode.markerMatcher.activeHintMarker - setMode: ({modeIndex}) -> @linkHintsMode.setOpenLinkMode availableModes[modeIndex], true + setMode: ({modeIndex}) -> @linkHintsMode.setOpenLinkMode availableModes[modeIndex], false getLocalHintMarker: (hint) -> if hint.frameId == frameId then @localHints[hint.localIndex] else null exit: -> @@ -140,7 +140,7 @@ class LinkHintsModeBase (event?.type == "keydown" and event.keyCode in [ keyCodes.backspace, keyCodes.deleteKey ]) HintCoordinator.sendMessage "exitFailure" - @setOpenLinkMode mode, true + @setOpenLinkMode mode, false # Note(philc): Append these markers as top level children instead of as child nodes to the link itself, # because some clickable elements cannot contain children, e.g. submit buttons. @@ -150,9 +150,9 @@ class LinkHintsModeBase @hideMarker marker for marker in hintMarkers when marker.hint.frameId != frameId @postKeyState = @postKeyState.bind this, hintMarkers - setOpenLinkMode: (@mode, doNotPropagate = false) -> - @hintMode.setIndicator @mode.indicator if DomUtils.isTopFrame() - unless doNotPropagate + setOpenLinkMode: (@mode, shouldPropagtetoOtherFrames = true) -> + @hintMode.setIndicator @mode.indicator if windowIsFocused() + if shouldPropagtetoOtherFrames HintCoordinator.sendMessage "setMode", modeIndex: availableModes.indexOf @mode # |
