});
});
-require(["dojo/_base/declare", "dijit/Tree", "dijit/Menu"], function (declare) {
+require(["dojo/_base/declare", "dojo/dom-construct", "dijit/Tree", "dijit/Menu"], function (declare, domConstruct) {
return declare("fox.FeedTree", dijit.Tree, {
_onKeyPress: function(/* Event */ e) {
_createTreeNode: function(args) {
var tnode = new dijit._TreeNode(args);
- if (args.item.icon && args.item.icon[0])
- tnode.iconNode.src = args.item.icon[0];
+ var icon = dojo.doc.createElement('img');
+ if (args.item.icon && args.item.icon[0]) {
+ icon.src = args.item.icon[0];
+ } else {
+ icon.src = 'images/blank_icon.gif';
+ }
+ icon.className = 'tinyFeedIcon';
+ domConstruct.place(icon, tnode.iconNode, 'only');
var id = args.item.id[0];
var bare_id = parseInt(id.substr(id.indexOf(':')+1));
color: fg_color,
backgroundColor: bg_color});
- dojo.place(span, tnode.iconNode, 'replace');
+ domConstruct.place(span, tnode.iconNode, 'only');
}
if (id.match("FEED:")) {
menu.row_id = bare_id;
menu.addChild(new dijit.MenuItem({
- label: __("(Un)collapse"),
+ label: __("Mark as read"),
onClick: function() {
- dijit.byId("feedTree").collapseCat(this.getParent().row_id);
+ catchupFeed(this.getParent().row_id, true);
}}));
menu.addChild(new dijit.MenuItem({
- label: __("Mark as read"),
+ label: __("(Un)collapse"),
onClick: function() {
- catchupFeed(this.getParent().row_id, true);
+ dijit.byId("feedTree").collapseCat(this.getParent().row_id);
}}));
menu.bindDomNode(tnode.domNode);
loading = dojo.doc.createElement('img');
loading.className = 'loadingNode';
loading.src = 'images/blank_icon.gif';
- dojo.place(loading, tnode.labelNode, 'after');
+ domConstruct.place(loading, tnode.labelNode, 'after');
tnode.loadingNode = loading;
}
args.item.unread == 0 && args.item.auxcounter > 0 ? ctr.addClassName("aux") : ctr.removeClassName("aux");
- dojo.place(ctr, tnode.rowNode, 'first');
+ domConstruct.place(ctr, tnode.rowNode, 'first');
tnode.counterNode = ctr;
//tnode.labelNode.innerHTML = args.label;
ctr = node.counterNode;
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 }}) :
+ item.unread > 0 ?
+ Effect.Appear(ctr, {duration : 0.3,
+ queue: { position: 'end', scope: 'CAPPEAR-' + item.id, limit: 1 }}) :
+ Element.show(ctr) :
Element.hide(ctr);
item.unread == 0 && item.auxcounter > 0 ? ctr.addClassName("aux") : ctr.removeClassName("aux");
if (treeNode) {
treeNode = treeNode[0];
- treeNode.iconNode.src = src;
+ var icon = dojo.doc.createElement('img');
+ icon.src = src;
+ icon.className = 'tinyFeedIcon';
+ domConstruct.place(icon, treeNode.iconNode, 'only');
return true;
}
return false;
treeNode.loadingNode.src = src;
return true;
} else {
- treeNode.expandoNode.src = src;
+ var icon = dojo.doc.createElement('img');
+ icon.src = src;
+ icon.className = 'loadingExpando';
+ domConstruct.place(icon, treeNode.expandoNode, 'only');
return true;
}
}