From fbb4155bae2a0856172e234dc8292645d707091b Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 7 May 2013 20:03:09 +0400 Subject: [PATCH] counterNode: use appear effect --- js/FeedTree.js | 11 ++++++++--- tt-rss.css | 4 ---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/js/FeedTree.js b/js/FeedTree.js index 7cc3aabb..5bca1af8 100644 --- a/js/FeedTree.js +++ b/js/FeedTree.js @@ -188,7 +188,9 @@ dojo.declare("fox.FeedTree", dijit.Tree, { ctr.className = 'counterNode'; ctr.innerHTML = args.item.unread; - args.item.unread > 0 ? ctr.addClassName("unread") : ctr.removeClassName("unread"); + //args.item.unread > 0 ? ctr.addClassName("unread") : ctr.removeClassName("unread"); + + args.item.unread > 0 ? Element.show(ctr) : Element.hide(ctr); dojo.place(ctr, tnode.labelNode, 'after'); tnode.counterNode = ctr; @@ -212,8 +214,11 @@ dojo.declare("fox.FeedTree", dijit.Tree, { node = node[0]; if (node.counterNode) { - node.counterNode.innerHTML = item.unread; - item.unread > 0 ? node.counterNode.addClassName("unread") : node.counterNode.removeClassName("unread"); + ctr = node.counterNode; + ctr.innerHTML = item.unread; + item.unread > 0 ? Effect.Appear(ctr, {duration : 0.3, + queue: { position: 'end', scope: 'CAPPEAR-' + item.id, limit: 1 }}) : + Element.hide(ctr); } } diff --git a/tt-rss.css b/tt-rss.css index a9b03fe3..f05b554f 100644 --- a/tt-rss.css +++ b/tt-rss.css @@ -1051,10 +1051,6 @@ div.hl.active { } #feedTree span.counterNode { - display : none; -} - -#feedTree span.counterNode.unread { font-weight : bold; display : inline-block; font-size : 9px; -- 2.39.5