From 48b1ece35fec488cf52cae79488fb7fab33fed6f Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Thu, 16 Mar 2017 22:49:57 -0400 Subject: [PATCH] News dashlet - don't show count when it's zero --- templates/CRM/Dashlet/Page/Blog.tpl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/templates/CRM/Dashlet/Page/Blog.tpl b/templates/CRM/Dashlet/Page/Blog.tpl index 729e39bb7c..3ee2e1597d 100644 --- a/templates/CRM/Dashlet/Page/Blog.tpl +++ b/templates/CRM/Dashlet/Page/Blog.tpl @@ -104,12 +104,17 @@ $(this).one('crmAccordion:open', function () { $('.crm-news-feed-item-title', this).css('font-weight', ''); $('em', $tab).text(--count); + if (!count) { + $('em', $tab).remove(); + } opened[key].push(itemKey); localStorage.newsFeed = JSON.stringify(opened); }); } }); - $tab.html($tab.text() + ' ' + count + ''); + if (count) { + $tab.html($tab.text() + ' ' + count + ''); + } // Remove items from localstorage that are no longer in the current feed $.each(opened[key], function(i, itemKey) { if (!$('a[href="' + itemKey + '"]', $content).length) { -- 2.25.1