From b42fd99bd04a4ff8e7be963a7cd895c20a3e489a Mon Sep 17 00:00:00 2001 From: gorhill Date: Sun, 2 Nov 2014 18:43:12 -0500 Subject: [PATCH] no badge when count is zero --- src/js/pagestats.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/js/pagestats.js b/src/js/pagestats.js index cb9ef86..4aaa54f 100644 --- a/src/js/pagestats.js +++ b/src/js/pagestats.js @@ -568,20 +568,18 @@ PageStore.prototype.recordRequest = function(type, url, block) { PageStore.prototype.updateBadge = function(tabId) { // Icon var iconPath; + var badgeStr = ''; var total = this.perLoadAllowedRequestCount + this.perLoadBlockedRequestCount; if ( total ) { var squareSize = 19; var greenSize = squareSize * Math.sqrt(this.perLoadAllowedRequestCount / total); greenSize = greenSize < squareSize/2 ? Math.ceil(greenSize) : Math.floor(greenSize); iconPath = 'img/browsericons/icon19-' + greenSize + '.png'; + badgeStr = µm.formatCount(this.distinctRequestCount); } else { iconPath = 'img/browsericons/icon19.png'; } - µm.XAL.setIcon( - tabId, - iconPath, - µm.formatCount(this.distinctRequestCount) - ); + µm.XAL.setIcon(tabId, iconPath, badgeStr); }; /******************************************************************************/