aboutsummaryrefslogtreecommitdiffstats
path: root/content_scripts/vomnibar.coffee
diff options
context:
space:
mode:
authorStephen Blott2016-04-02 16:54:11 +0100
committerStephen Blott2016-04-02 17:02:41 +0100
commit96c74e4aa7e39a99bf5511440ba7a4155f1e2db8 (patch)
tree10ac55d9efa915c4f17522961554e4540e3607e2 /content_scripts/vomnibar.coffee
parent4f74307ed382ce942a1210007b99ed426f997a81 (diff)
downloadvimium-96c74e4aa7e39a99bf5511440ba7a4155f1e2db8.tar.bz2
Simplify UI component initialisation.
There's no need for the previous complicated approach to UI component initialialisation, in particular for the Vomnibar. We only initialise the Vomnibar in the top frame. However, if for some reason it hasn't been initialised by the time it's needed, then we can just initialise it then. We are only initialising it early to avoid flicker, so it's not a correctness issue. And the only reason it wouldn't be initialised is if Vimium is disabled in the top frame, but enabled in some other frame -- which is not a common case.
Diffstat (limited to 'content_scripts/vomnibar.coffee')
-rw-r--r--content_scripts/vomnibar.coffee4
1 files changed, 3 insertions, 1 deletions
diff --git a/content_scripts/vomnibar.coffee b/content_scripts/vomnibar.coffee
index 67a79ff4..a19a9b70 100644
--- a/content_scripts/vomnibar.coffee
+++ b/content_scripts/vomnibar.coffee
@@ -62,7 +62,9 @@ Vomnibar =
# query - Optional. Text to prefill the Vomnibar with.
# selectFirst - Optional, boolean. Whether to select the first entry.
# newTab - Optional, boolean. Whether to open the result in a new tab.
- open: (sourceFrameId, options) -> @vomnibarUI.activate extend options, { sourceFrameId }
+ open: (sourceFrameId, options) ->
+ @init()
+ @vomnibarUI.activate extend options, { sourceFrameId }
root = exports ? window
root.Vomnibar = Vomnibar