]> git.wh0rd.org - tt-rss.git/blobdiff - js/FeedTree.js
remove long forgotten stuff related to feed debugging actionbar
[tt-rss.git] / js / FeedTree.js
index 5052f38dc28db8d9f3ebab2a8bc3f703d18f72fa..63fa308f02f64c4c70f80fa1de39aab98a597477 100644 (file)
@@ -104,8 +104,14 @@ require(["dojo/_base/declare", "dojo/dom-construct", "dijit/Tree", "dijit/Menu"]
                _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));
@@ -121,7 +127,7 @@ require(["dojo/_base/declare", "dojo/dom-construct", "dijit/Tree", "dijit/Menu"]
                                        color: fg_color,
                                        backgroundColor: bg_color});
 
-                               domConstruct.place(span, tnode.iconNode, 'replace');
+                               domConstruct.place(span, tnode.iconNode, 'only');
                        }
 
                        if (id.match("FEED:")) {
@@ -232,8 +238,10 @@ require(["dojo/_base/declare", "dojo/dom-construct", "dijit/Tree", "dijit/Menu"]
                                        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");
@@ -294,7 +302,7 @@ require(["dojo/_base/declare", "dojo/dom-construct", "dijit/Tree", "dijit/Menu"]
                                        }
                                }
                        } catch (e) {
-                               exception_error("expandParentNodes", e);
+                               exception_error(e);
                        }
                },
                findNodeParentsAndExpandThem: function(feed, is_cat, root, parents) {
@@ -333,7 +341,7 @@ require(["dojo/_base/declare", "dojo/dom-construct", "dijit/Tree", "dijit/Menu"]
                                        }
                                }
                        } catch (e) {
-                               exception_error("findNodeParentsAndExpandThem", e);
+                               exception_error(e);
                        }
                },
                selectFeed: function(feed, is_cat) {
@@ -348,6 +356,12 @@ require(["dojo/_base/declare", "dojo/dom-construct", "dijit/Tree", "dijit/Menu"]
                                treeNode = treeNode[0];
                                if (!is_cat) this._expandNode(treeNode);
                                this.set("selectedNodes", [treeNode]);
+                               this.focusNode(treeNode);
+
+                               // focus headlines to route key events there
+                               setTimeout(function() {
+                                       $("headlines-frame").focus();
+                               }, 0);
                        }
                },
                setFeedIcon: function(feed, is_cat, src) {
@@ -358,7 +372,10 @@ require(["dojo/_base/declare", "dojo/dom-construct", "dijit/Tree", "dijit/Menu"]
 
                        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;
@@ -375,7 +392,10 @@ require(["dojo/_base/declare", "dojo/dom-construct", "dijit/Tree", "dijit/Menu"]
                                        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;
                                }
                        }