aboutsummaryrefslogtreecommitdiffstats
path: root/content_scripts/ui_component.coffee
diff options
context:
space:
mode:
authormrmr19932014-12-29 10:38:25 +0000
committermrmr19932014-12-29 10:38:25 +0000
commit0433dd338258dc39466593e0bce5fa3253f8d6d5 (patch)
tree4cc3a99de2510bd107b6f762eab6f2e1792e2f6a /content_scripts/ui_component.coffee
parent4e3ef0b401cfb4682a17a1ee88058ed76d64be20 (diff)
downloadvimium-0433dd338258dc39466593e0bce5fa3253f8d6d5.tar.bz2
Allow message passing directly from UIComponent.show
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 b0e4f71c..f0593f1b 100644
--- a/content_scripts/ui_component.coffee
+++ b/content_scripts/ui_component.coffee
@@ -29,9 +29,9 @@ class UIComponent
chrome.storage.local.get "iframeMessageSecret", ({iframeMessageSecret: secret}) =>
@iframeElement.contentWindow.postMessage secret, chrome.runtime.getURL(""), [messageChannel.port2]
- postMessage: (data) -> @iframePort.postMessage data
+ postMessage: (message) -> @iframePort.postMessage message
- # Execute each event listener on the current event until we get a falsy return value.
+ # Execute each event listener on the current event until we get a non-null falsy return value.
handleMessage: (event) ->
for listener in @messageEventListeners
retVal = listener.call this, event
@@ -61,7 +61,8 @@ class UIComponent
else
@hide()
- show: ->
+ show: (message) ->
+ @postMessage message if message?
@iframeElement.setAttribute "style", @showStyle
@iframeElement.focus()
@showing = true