diff options
| author | mrmr1993 | 2015-05-11 16:09:58 +0100 |
|---|---|---|
| committer | mrmr1993 | 2015-05-11 16:33:49 +0100 |
| commit | 597feb0bbac9480499f65c8503c33a1b5ae1c327 (patch) | |
| tree | 5b2c6631b26599c5dcf3d5bed159b73ca74549dd /content_scripts/hud.coffee | |
| parent | ecf2535be3655a1309f7fcf5fb0040addb7c97fd (diff) | |
| download | vimium-597feb0bbac9480499f65c8503c33a1b5ae1c327.tar.bz2 | |
Change HUD. to @ for improved readability
Diffstat (limited to 'content_scripts/hud.coffee')
| -rw-r--r-- | content_scripts/hud.coffee | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/content_scripts/hud.coffee b/content_scripts/hud.coffee index 9b23d050..e0dbb385 100644 --- a/content_scripts/hud.coffee +++ b/content_scripts/hud.coffee @@ -11,26 +11,26 @@ HUD = # it doesn't sit on top of horizontal scrollbars like Chrome's HUD does. showForDuration: (text, duration) -> - HUD.show(text) - HUD._showForDurationTimerId = setTimeout((-> HUD.hide()), duration) + @show(text) + @_showForDurationTimerId = setTimeout((=> @hide()), duration) show: (text) -> - return unless HUD.enabled() - clearTimeout(HUD._showForDurationTimerId) - HUD.displayElement().innerText = text - clearInterval(HUD._tweenId) - HUD._tweenId = Tween.fade(HUD.displayElement(), 1.0, 150) - HUD.displayElement().style.display = "" + return unless @enabled() + clearTimeout(@_showForDurationTimerId) + @displayElement().innerText = text + clearInterval(@_tweenId) + @_tweenId = Tween.fade(@displayElement(), 1.0, 150) + @displayElement().style.display = "" # # Retrieves the HUD HTML element. # displayElement: -> - if (!HUD._displayElement) - HUD._displayElement = HUD.createHudElement() + if (!@_displayElement) + @_displayElement = @createHudElement() # Keep this far enough to the right so that it doesn't collide with the "popups blocked" chrome HUD. - HUD._displayElement.style.right = "150px" - HUD._displayElement + @_displayElement.style.right = "150px" + @_displayElement createHudElement: -> element = document.createElement("div") @@ -43,12 +43,12 @@ 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) -> - clearInterval(HUD._tweenId) + clearInterval(@_tweenId) if immediate - HUD.displayElement().style.display = "none" unless updateIndicator + @displayElement().style.display = "none" unless updateIndicator Mode.setIndicator() if updateIndicator else - HUD._tweenId = Tween.fade HUD.displayElement(), 0, 150, -> HUD.hide true, updateIndicator + @_tweenId = Tween.fade @displayElement(), 0, 150, => @hide true, updateIndicator isReady: do -> ready = false |
