From f946d23125a80233799564b57253ace2c44b8994 Mon Sep 17 00:00:00 2001 From: mrmr1993 Date: Tue, 30 Dec 2014 15:20:49 +0000 Subject: Reinstate UIComponent.show --- content_scripts/ui_component.coffee | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'content_scripts') diff --git a/content_scripts/ui_component.coffee b/content_scripts/ui_component.coffee index 696cb42c..8b229725 100644 --- a/content_scripts/ui_component.coffee +++ b/content_scripts/ui_component.coffee @@ -38,15 +38,18 @@ class UIComponent @iframeElement.style.border = '5px solid yellow' setTimeout((=> @iframeElement.style.border = borderWas), 200) else - @iframeElement.setAttribute "style", @showStyle - @showing = true + @show() @iframeElement.focus() + show: (message) -> + @postMessage message if message? + @iframeElement.setAttribute "style", @showStyle + @showing = true + hide: (focusWindow = true)-> - if @showing - @iframeElement.setAttribute "style", @hideStyle - window.focus() if focusWindow - @showing = false + @iframeElement.setAttribute "style", @hideStyle + window.focus() if focusWindow + @showing = false root = exports ? window root.UIComponent = UIComponent -- cgit v1.2.3