diff options
| author | Stephen Blott | 2015-01-18 06:27:38 +0000 |
|---|---|---|
| committer | Stephen Blott | 2015-01-18 10:25:31 +0000 |
| commit | 0e59b99e95e6a4fd3f64fd284e7417ba5f7e22e1 (patch) | |
| tree | 19fddb33de1e00b8024c4cb5c86dc483169da885 /background_scripts | |
| parent | 9cb0f2853a155e39270282e6ed224966afffc61e (diff) | |
| download | vimium-0e59b99e95e6a4fd3f64fd284e7417ba5f7e22e1.tar.bz2 | |
Modes; pre-merge clean up.
Diffstat (limited to 'background_scripts')
| -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. |
