aboutsummaryrefslogtreecommitdiffstats
path: root/content_scripts/hud.coffee
diff options
context:
space:
mode:
authorStephen Blott2015-05-12 06:33:13 +0100
committerStephen Blott2015-05-12 06:33:13 +0100
commit26f91fea40f11c116497ce20c1fe53f3956a922f (patch)
tree1d22db129bdca582418f4d515c38692894629b9b /content_scripts/hud.coffee
parent7004420e178416cc680416091a23dd804fb9370c (diff)
downloadvimium-26f91fea40f11c116497ce20c1fe53f3956a922f.tar.bz2
Fix HUD on options page (temporary fix, v2).
Alternative to 7004420e178416cc680416091a23dd804fb9370c.
Diffstat (limited to 'content_scripts/hud.coffee')
-rw-r--r--content_scripts/hud.coffee5
1 files changed, 2 insertions, 3 deletions
diff --git a/content_scripts/hud.coffee b/content_scripts/hud.coffee
index dcb95fd9..05fa998d 100644
--- a/content_scripts/hud.coffee
+++ b/content_scripts/hud.coffee
@@ -11,14 +11,13 @@ HUD =
# it doesn't sit on top of horizontal scrollbars like Chrome's HUD does.
init: ->
- @tween ?= new Tween ".vimiumHUD.vimiumUIComponentVisible"
+ @tween = new Tween ".vimiumHUD.vimiumUIComponentVisible"
showForDuration: (text, duration) ->
@show(text)
@_showForDurationTimerId = setTimeout((=> @hide()), duration)
show: (text) ->
- @init()
return unless @enabled()
clearTimeout(@_showForDurationTimerId)
@displayElement().innerText = text
@@ -42,7 +41,7 @@ HUD =
# If :updateIndicator is truthy, then we also refresh the mode indicator. The only time we don't update the
# mode indicator, is when hide() is called for the mode indicator itself.
hide: (immediate = false, updateIndicator = true) ->
- @init()
+ return unless @tween?
@tween.stop()
if immediate
unless updateIndicator