diff options
Diffstat (limited to 'content_scripts/ui_component.coffee')
| -rw-r--r-- | content_scripts/ui_component.coffee | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/content_scripts/ui_component.coffee b/content_scripts/ui_component.coffee index 3d8cef29..185d525a 100644 --- a/content_scripts/ui_component.coffee +++ b/content_scripts/ui_component.coffee @@ -15,9 +15,11 @@ class UIComponent # Hide the iframe, but don't interfere with the focus. @hide false - # If any other frame in the current tab receives the focus, then we hide the vomnibar. + # If any other frame in the current tab receives the focus, then we hide the UI component. + # NOTE(smblott) This is correct for the vomnibar, but might be incorrect (and need to be revisited) for + # other UI components. chrome.runtime.onMessage.addListener (request) => - @hide false if @showing and request.name == "frameFocused" and request.frameId != frameId + @hide false if @showing and request.name == "frameFocused" and request.focusFrameId != frameId false # Free up response handler. # Open a port and pass it to the iframe via window.postMessage. @@ -57,12 +59,12 @@ class UIComponent @iframeElement.classList.add "vimiumUIComponentHidden" window.removeEventListener "focus", @onFocus if @onFocus @onFocus = null - if focusWindow and @options?.frameId? + if focusWindow and @options?.sourceFrameId? chrome.runtime.sendMessage handler: "sendMessageToFrames" message: name: "focusFrame" - frameId: @options.frameId + frameId: @options.sourceFrameId highlight: true # true for debugging; should be false when live. @options = null @showing = false |
