diff options
| author | Stephen Blott | 2015-01-15 18:00:18 +0000 |
|---|---|---|
| committer | Stephen Blott | 2015-01-16 05:30:17 +0000 |
| commit | 091cd99b6fcbb17f30e552b0c0f6461c4c1529cb (patch) | |
| tree | 7d433371cafe0e94df90c5d9d200ca3727e65733 /content_scripts/vimium_frontend.coffee | |
| parent | 46d4cb903494be6df2b2e570e11f3854ec99c3aa (diff) | |
| download | vimium-091cd99b6fcbb17f30e552b0c0f6461c4c1529cb.tar.bz2 | |
Modes; refactoring.
- refactor PostFindMode (to keep separate functionality separated).
Diffstat (limited to 'content_scripts/vimium_frontend.coffee')
| -rw-r--r-- | content_scripts/vimium_frontend.coffee | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee index 7d24e714..3049784e 100644 --- a/content_scripts/vimium_frontend.coffee +++ b/content_scripts/vimium_frontend.coffee @@ -364,11 +364,14 @@ extend window, id: "vimiumInputMarkerContainer" className: "vimiumReset" - new class FocusSelector extends InputController + new class FocusSelector extends Mode constructor: -> super name: "focus-selector" badge: "?" + # We share a singleton with PostFindMode. That way, a new FocusSelector displaces any existing + # PostFindMode. + singleton: PostFindMode exitOnClick: true keydown: (event) => if event.keyCode == KeyboardUtils.keyCodes.tab @@ -805,10 +808,12 @@ executeFind = (query, options) -> # preventDefault() findModeAnchorNode = document.getSelection().anchorNode - # If the anchor node is outside of the active element, then blur the active element. We don't want to leave - # behind an inappropriate active element. This fixes #1412. - if document.activeElement and not DomUtils.isDOMDescendant findModeAnchorNode, document.activeElement - document.activeElement.blur() + # TODO(smblott). Disabled. This is the wrong test. Should be reinstated when we have the right test, which + # looks like it should be "isSelected" from #1431. + # # If the anchor node not a descendent of the active element, then blur the active element. We don't want to + # # leave behind an inappropriate active element. This fixes #1412. + # if document.activeElement and not DomUtils.isDOMDescendant document.activeElement, findModeAnchorNode + # document.activeElement.blur() result |
