aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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