diff options
Diffstat (limited to 'background_scripts/main.coffee')
| -rw-r--r-- | background_scripts/main.coffee | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee index 83a6b3f8..c1c8dfc8 100644 --- a/background_scripts/main.coffee +++ b/background_scripts/main.coffee @@ -347,7 +347,7 @@ chrome.browserAction.setBadgeBackgroundColor color: [82, 156, 206, 255] setBadge = do -> - current = "" + current = null timer = null updateBadge = (badge) -> -> chrome.browserAction.setBadgeText text: badge (request) -> @@ -355,13 +355,8 @@ setBadge = do -> if badge? and badge != current current = badge clearTimeout timer if timer - if badge == "" - # We set an empty badge immediately. This is the common case when changing tabs. - updateBadge(badge)() - else - # We wait a few milliseconds before setting any other badge. This avoids badge flicker when there are - # rapid changes (e.g. InsertMode is activated by find, followed almost immediately by PostFindMode). - timer = setTimeout updateBadge(badge), 50 + # We wait a few moments. This avoids badge flicker when there are rapid changes. + timer = setTimeout updateBadge(badge), 50 # Updates the browserAction icon to indicate whether Vimium is enabled or disabled on the current page. # Also propagates new enabled/disabled/passkeys state to active window, if necessary. |
