if (is_cat) {
treeItem = this.store._itemsByIdentity['CAT:' + feed];
- items = this.store._arrayOfTopLevelItems;
} else {
treeItem = this.store._itemsByIdentity['FEED:' + feed];
- items = this.store._arrayOfAllItems;
}
+ items = this.store._arrayOfAllItems;
+
for (var i = 0; i < items.length; i++) {
if (items[i] == treeItem) {
var unread = this.store.getValue(items[j], 'unread');
var id = this.store.getValue(items[j], 'id');
- if (unread > 0 && (is_cat || id.match("FEED:"))) return items[j];
+ if (unread > 0 && ((is_cat && id.match("CAT:")) || (!is_cat && id.match("FEED:")))) {
+ if( !is_cat || ! (this.store.hasAttribute(items[j], 'parent_id') && this.store.getValue(items[j], 'parent_id') == feed) ) return items[j];
+ }
}
for (var j = 0; j < i; j++) {
var unread = this.store.getValue(items[j], 'unread');
var id = this.store.getValue(items[j], 'id');
- if (unread > 0 && (is_cat || id.match("FEED:"))) return items[j];
+ if (unread > 0 && ((is_cat && id.match("CAT:")) || (!is_cat && id.match("FEED:")))) {
+ if( !is_cat || ! (this.store.hasAttribute(items[j], 'parent_id') && this.store.getValue(items[j], 'parent_id') == feed) ) return items[j];
+ }
}
}
}
ctr = dojo.doc.createElement('span');
ctr.className = 'counterNode';
- ctr.innerHTML = args.item.unread;
+ ctr.innerHTML = args.item.unread > 0 ? args.item.unread : args.item.auxcounter;
//args.item.unread > 0 ? ctr.addClassName("unread") : ctr.removeClassName("unread");
- args.item.unread > 0 ? Element.show(ctr) : Element.hide(ctr);
+ args.item.unread > 0 || args.item.auxcounter > 0 ? Element.show(ctr) : Element.hide(ctr);
+
+ args.item.unread == 0 && args.item.auxcounter > 0 ? ctr.addClassName("aux") : ctr.removeClassName("aux");
dojo.place(ctr, tnode.rowNode, 'first');
tnode.counterNode = ctr;
if (node.counterNode) {
ctr = node.counterNode;
- ctr.innerHTML = item.unread;
- item.unread > 0 ? Effect.Appear(ctr, {duration : 0.3,
+ ctr.innerHTML = item.unread > 0 ? item.unread : item.auxcounter;
+ item.unread > 0 || item.auxcounter > 0 ?
+ Effect.Appear(ctr, {duration : 0.3,
queue: { position: 'end', scope: 'CAPPEAR-' + item.id, limit: 1 }}) :
Element.hide(ctr);
+
+ item.unread == 0 && item.auxcounter > 0 ? ctr.addClassName("aux") : ctr.removeClassName("aux");
+
}
}
}
items = this.model.store._arrayOfAllItems;
- var item = items[0];
+ var item = items[0] == treeItem ? items[items.length-1] : items[0];
for (var i = 0; i < items.length; i++) {
if (items[i] == treeItem) {