diff options
| author | Stephen Blott | 2015-03-17 09:18:52 +0000 | 
|---|---|---|
| committer | Stephen Blott | 2015-03-17 09:18:52 +0000 | 
| commit | efada88f419933c5bd1478faada3b4eff3082103 (patch) | |
| tree | d65543b704ed2da6545c89bf1996ff7c84e02e78 /content_scripts/ui_component.coffee | |
| parent | 1ae621489da091e6d9430da248d0e6eaab606f35 (diff) | |
| download | vimium-efada88f419933c5bd1478faada3b4eff3082103.tar.bz2 | |
Activate vomnibar in window.top; refocus original frame.
Diffstat (limited to 'content_scripts/ui_component.coffee')
| -rw-r--r-- | content_scripts/ui_component.coffee | 14 | 
1 files changed, 11 insertions, 3 deletions
diff --git a/content_scripts/ui_component.coffee b/content_scripts/ui_component.coffee index b582cb5d..3a4af6b5 100644 --- a/content_scripts/ui_component.coffee +++ b/content_scripts/ui_component.coffee @@ -2,6 +2,7 @@ class UIComponent    iframeElement: null    iframePort: null    showing: null +  options: null    constructor: (iframeUrl, className, @handleMessage) ->      @iframeElement = document.createElement "iframe" @@ -27,8 +28,8 @@ class UIComponent    postMessage: (message) ->      @iframePort.postMessage message -  activate: (message) -> -    @postMessage message if message? +  activate: (@options) -> +    @postMessage @options if @options?      @show() unless @showing      @iframeElement.focus() @@ -51,7 +52,14 @@ class UIComponent      @iframeElement.classList.add "vimiumUIComponentHidden"      window.removeEventListener "focus", @onFocus if @onFocus      @onFocus = null -    window.focus() if focusWindow +    if focusWindow and @options?.frameId? +      chrome.runtime.sendMessage +        handler: "sendMessageToFrame" +        frameId: frameId +        targetFrameId: @options.frameId +        name: "focusFrame" +        highlight: true # true for debugging; should be false when live. +    @options = null      @showing = false  root = exports ? window  | 
