Created
January 15, 2010 16:48
-
-
Save ryszard/278193 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
if (window.fluid) { | |
var unread = 0; | |
var focused = false; | |
window.fluid.dockBadge = ""; | |
var orig = BLIP.updater.addUnreaded; | |
BLIP.updater.addUnreaded = function (a) { | |
orig(a); | |
unread += a; | |
if (unread != 0 && !focused) { | |
window.fluid.dockBadge = unread; | |
} | |
else { | |
window.fluid.dockBadge = ""; | |
} | |
}; | |
Event.observe(window, 'blur', function() { focused = false;}); | |
Event.observe(window, 'focus', function() { | |
unread = 0; | |
focused = true; | |
window.fluid.dockBadge = ""; | |
}); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment