From: Andrew Dolgov Date: Wed, 6 Dec 2006 09:11:59 +0000 (+0100) Subject: tweak category counter display, new styles: .catCtrNoUnread, .catCtrHasUnread X-Git-Tag: 1.2.6~28 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=67dabe1a86fbe7ef5bc157eb3096e1d64f1538f8;p=tt-rss.git tweak category counter display, new styles: .catCtrNoUnread, .catCtrHasUnread --- diff --git a/functions.js b/functions.js index c3158e34..a3a46a9c 100644 --- a/functions.js +++ b/functions.js @@ -529,7 +529,12 @@ function parse_counters(reply, scheduled_call) { if (t == "category") { var catctr = document.getElementById("FCATCTR-" + id); if (catctr) { - catctr.innerHTML = "(" + ctr + " unread)"; + catctr.innerHTML = "(" + ctr + ")"; + if (ctr > 0) { + catctr.className = "catCtrHasUnread"; + } else { + catctr.className = "catCtrNoUnread"; + } } continue; } diff --git a/functions.php b/functions.php index c07f95b2..83f37b61 100644 --- a/functions.php +++ b/functions.php @@ -2926,12 +2926,14 @@ $cat_id = sprintf("%d", $cat_id); $cat_unread = getCategoryUnread($link, $cat_id); - + + $catctr_class = ($cat_unread > 0) ? "catCtrHasUnread" : "catCtrNoUnread"; + print "
  • - $tmp_category + $tmp_category - ($cat_unread unread) $ellipsis + ($cat_unread) $ellipsis
  • "; // !!! NO SPACE before