From c5d0ed09b8ed5c0351e11f985ceeae244f0f0caa Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Sat, 9 Apr 2016 08:44:21 +0100 Subject: A UI component isn't ready until it's ready. 1. Do not initialize UI components until the DOm is ready. 2. Do not register UI components as ready (specifically the HUD) until the full initialization sequence is complete. This goes some way towards fixing the issue described in this comment: https://github.com/philc/vimium/issues/2081#issuecomment-205758102 It relates to link-hints mode hanging when launched during a navigation. This problem exists in 1.54, but emerged during testing of global link hints. "Some way toeards fixing..." because it is still possible to trigger issues. --- content_scripts/hud.coffee | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'content_scripts/hud.coffee') diff --git a/content_scripts/hud.coffee b/content_scripts/hud.coffee index 92de975b..bbf7c5e9 100644 --- a/content_scripts/hud.coffee +++ b/content_scripts/hud.coffee @@ -23,13 +23,13 @@ HUD = @_showForDurationTimerId = setTimeout((=> @hide()), duration) show: (text) -> - return unless @enabled() + return unless @isReady() clearTimeout(@_showForDurationTimerId) @hudUI.show {name: "show", text} @tween.fade 1.0, 150 showFindMode: (@findMode = null) -> - return unless @enabled() + return unless @isReady() @hudUI.show {name: "showFindMode", text: ""} @tween.fade 1.0, 150 @@ -83,12 +83,7 @@ HUD = @findMode.exit() postExit?() - isReady: do -> - ready = false - DomUtils.documentReady -> ready = true - -> ready and document.body != null and @hudUI? - - enabled: -> true + isReady: -> @hudUI?.uiComponentIsReady class Tween opacity: 0 -- cgit v1.2.3