diff options
| author | Stephen Blott | 2016-04-17 11:57:16 +0100 |
|---|---|---|
| committer | Stephen Blott | 2016-04-17 11:57:16 +0100 |
| commit | cefbb461a3b564845a61893fcbe5faa0084c6f4c (patch) | |
| tree | 38743486ac59f76462d6d6da9c8c90038c467834 /content_scripts/hud.coffee | |
| parent | 014f53fb091ac8672d3efbeca13a494c15d8afcb (diff) | |
| parent | 5c3e4bda2968486e23f8cc3410e776de67fec849 (diff) | |
| download | vimium-cefbb461a3b564845a61893fcbe5faa0084c6f4c.tar.bz2 | |
Merge pull request #2100 from smblott-github/rework-ui-component-focus-handling
Rework ui component focus handling
Diffstat (limited to 'content_scripts/hud.coffee')
| -rw-r--r-- | content_scripts/hud.coffee | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/content_scripts/hud.coffee b/content_scripts/hud.coffee index bbf7c5e9..0bd1df3e 100644 --- a/content_scripts/hud.coffee +++ b/content_scripts/hud.coffee @@ -25,12 +25,12 @@ HUD = show: (text) -> return unless @isReady() clearTimeout(@_showForDurationTimerId) - @hudUI.show {name: "show", text} + @hudUI.activate {name: "show", text} @tween.fade 1.0, 150 showFindMode: (@findMode = null) -> return unless @isReady() - @hudUI.show {name: "showFindMode", text: ""} + @hudUI.activate name: "showFindMode" @tween.fade 1.0, 150 search: (data) -> @@ -50,19 +50,16 @@ HUD = clearTimeout(@_showForDurationTimerId) @tween.stop() if immediate - unless updateIndicator - @hudUI.hide() - @hudUI.postMessage {name: "hide"} - Mode.setIndicator() if updateIndicator + if updateIndicator then Mode.setIndicator() else @hudUI.hide() else @tween.fade 0, 150, => @hide true, updateIndicator hideFindMode: (data) -> @findMode.checkReturnToViewPort() - # An element element won't receive a focus event if the search landed on it while we were in the HUD - # iframe. To end up with the correct modes active, we create a focus/blur event manually after refocusing - # this window. + # An element won't receive a focus event if the search landed on it while we were in the HUD iframe. To + # end up with the correct modes active, we create a focus/blur event manually after refocusing this + # window. window.focus() focusNode = DomUtils.getSelectionFocusElement() |
