aboutsummaryrefslogtreecommitdiffstats
path: root/content_scripts
diff options
context:
space:
mode:
authormrmr19932017-08-15 16:46:44 +0100
committermrmr19932017-11-18 12:35:29 +0000
commit976221f84b9694a5aa544eff8f084b78ce8c78d9 (patch)
tree7e1c1a2e6e502c3b9210c72209e52497e6916c07 /content_scripts
parent5f36adb083b86324923a9a316541a84448475dc0 (diff)
downloadvimium-976221f84b9694a5aa544eff8f084b78ce8c78d9.tar.bz2
Initialize the HUD for clipboard operations if it hasn't been already
Diffstat (limited to 'content_scripts')
-rw-r--r--content_scripts/hud.coffee8
1 files changed, 6 insertions, 2 deletions
diff --git a/content_scripts/hud.coffee b/content_scripts/hud.coffee
index 928ae5fd..d4c38447 100644
--- a/content_scripts/hud.coffee
+++ b/content_scripts/hud.coffee
@@ -90,10 +90,14 @@ HUD =
# * we don't want to disrupt the focus in the page, in case the page is listening for focus/blur events.
# * the HUD shouldn't be active for this frame while any of the copy/paste commands are running.
copyToClipboard: (text) ->
- @hudUI.postMessage {name: "copyToClipboard", data: text}
+ DomUtils.documentComplete =>
+ @init()
+ @hudUI?.postMessage {name: "copyToClipboard", data: text}
pasteFromClipboard: (@pasteListener) ->
- @hudUI.postMessage {name: "pasteFromClipboard"}
+ DomUtils.documentComplete =>
+ @init()
+ @hudUI?.postMessage {name: "pasteFromClipboard"}
pasteResponse: ({data}) ->
@pasteListener data