aboutsummaryrefslogtreecommitdiffstats
path: root/content_scripts/ui_component.coffee
diff options
context:
space:
mode:
authormrmr19932015-05-13 00:16:20 +0100
committermrmr19932015-05-13 00:50:36 +0100
commit0e6692932d11e2c82514d65d0cd45e1325e2647c (patch)
treefd44712763fa15077b7e8d7b0467204649eddda6 /content_scripts/ui_component.coffee
parentbf03ebf7b806a2c3a3a3c529191adcc7309b4a53 (diff)
downloadvimium-0e6692932d11e2c82514d65d0cd45e1325e2647c.tar.bz2
Move the HUD to an iframe, managed by UIComponent
Diffstat (limited to 'content_scripts/ui_component.coffee')
-rw-r--r--content_scripts/ui_component.coffee7
1 files changed, 4 insertions, 3 deletions
diff --git a/content_scripts/ui_component.coffee b/content_scripts/ui_component.coffee
index 5e0bd5d5..938a8411 100644
--- a/content_scripts/ui_component.coffee
+++ b/content_scripts/ui_component.coffee
@@ -3,6 +3,7 @@ class UIComponent
iframePort: null
showing: null
options: null
+ shadowDOM: null
constructor: (iframeUrl, className, @handleMessage) ->
styleSheet = document.createElement "style"
@@ -18,9 +19,9 @@ class UIComponent
@iframeElement.addEventListener "load", => @openPort()
shadowWrapper = document.createElement "div"
# PhantomJS doesn't support createShadowRoot, so guard against its non-existance.
- shadowDOM = shadowWrapper.createShadowRoot?() ? shadowWrapper
- shadowDOM.appendChild styleSheet
- shadowDOM.appendChild @iframeElement
+ @shadowDOM = shadowWrapper.createShadowRoot?() ? shadowWrapper
+ @shadowDOM.appendChild styleSheet
+ @shadowDOM.appendChild @iframeElement
document.documentElement.appendChild shadowWrapper
@showing = true # The iframe is visible now.