Skip to content

Instantly share code, notes, and snippets.

@bchavet
Last active August 29, 2015 14:01
Show Gist options
  • Save bchavet/1db6c6f668177ae982de to your computer and use it in GitHub Desktop.
Save bchavet/1db6c6f668177ae982de to your computer and use it in GitHub Desktop.
window.fluid.dockBadge = '';
function updateDockBadge() {
var count = 0;
var notifications = jQuery('.yj-notifications-indicator-count').html().replace(/.*\s([0-9]*)\s.*/, '$1');
if (notifications.length) count += parseInt(notifications);
var messages = jQuery('.unread-count').html().replace(/.*\s([0-9]*)\s.*/, '$1');
if (messages.length) count += parseInt(messages);
window.fluid.dockBadge = count ? count : '';
}
setInterval(updateDockBadge, 2000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment