From 7499675455941251eaa69c93e7c66bfb1c6ae35c Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Mon, 29 Dec 2014 17:08:39 +0000 Subject: Clearer handling of @showing in UI component. --- content_scripts/ui_component.coffee | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'content_scripts') diff --git a/content_scripts/ui_component.coffee b/content_scripts/ui_component.coffee index a898d525..d89f0cc8 100644 --- a/content_scripts/ui_component.coffee +++ b/content_scripts/ui_component.coffee @@ -1,7 +1,7 @@ class UIComponent iframeElement: null iframePort: null - showing: true + showing: null showStyle: "display: block;" hideStyle: "display: none;" @@ -12,7 +12,8 @@ class UIComponent @iframeElement.src = chrome.runtime.getURL iframeUrl @iframeElement.addEventListener "load", => @openPort() document.documentElement.appendChild @iframeElement - # Hide iframe, but don't interfere with the focus. + @showing = true # The iframe is visible now. + # Hide the iframe, but don't interfere with the focus. @hide false # Open a port and pass it to the iframe via window.postMessage. @@ -44,7 +45,6 @@ class UIComponent hide: (focusWindow=true)-> if @showing @iframeElement.setAttribute "style", @hideStyle - # TODO(smblott) Is window always the right thing to focus, here? window.focus() if focusWindow @showing = false -- cgit v1.2.3