aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Blott2014-12-29 17:08:39 +0000
committerStephen Blott2014-12-29 17:08:39 +0000
commit7499675455941251eaa69c93e7c66bfb1c6ae35c (patch)
treec89d917c35f0df2018e2291433b2995ca7667a17
parent0524bdc3f76279e8930bfe4b1b42d93e0e9bf6e4 (diff)
downloadvimium-7499675455941251eaa69c93e7c66bfb1c6ae35c.tar.bz2
Clearer handling of @showing in UI component.
-rw-r--r--content_scripts/ui_component.coffee6
1 files changed, 3 insertions, 3 deletions
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