]> git.wh0rd.org Git - tt-rss.git/commitdiff
add little loading indicator for feed categories
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Tue, 19 Mar 2013 16:29:20 +0000 (20:29 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Tue, 19 Mar 2013 16:29:20 +0000 (20:29 +0400)
js/FeedTree.js
js/feedlist.js

index 0b75629f0e968b14b0c0913664ad2ea4808ae218..b02d8ad7c2f864e061f978c3e3c3896ed0541abc 100644 (file)
@@ -162,6 +162,13 @@ dojo.declare("fox.FeedTree", dijit.Tree, {
                        tnode._menu = menu;
                }
 
+               if (id.match("CAT:")) {
+                       loading = dojo.doc.createElement('img');
+                       loading.className = 'loadingNode';
+                       dojo.place(loading, tnode.labelNode, 'after');
+                       tnode.loadingNode = loading;
+               }
+
                if (id.match("CAT:") && bare_id == -1) {
                        var menu = new dijit.Menu();
                        menu.row_id = bare_id;
@@ -243,8 +250,15 @@ dojo.declare("fox.FeedTree", dijit.Tree, {
 
                if (treeNode) {
                        treeNode = treeNode[0];
-                       treeNode.expandoNode.src = src;
-                       return true;
+                       if (is_cat) {
+                               if (treeNode.loadingNode) {
+                                       treeNode.loadingNode.src = src;
+                                       return true;
+                               }
+                       } else {
+                               treeNode.expandoNode.src = src;
+                               return true;
+                       }
                }
 
                return false;
index 4dc8b503e8a833f6ca334d78276c5f5bec5cd485..ae4c3a2fb6aafbf4c435d8717414ef5649d4c84e 100644 (file)
@@ -125,13 +125,11 @@ function viewfeed(feed, method, is_cat, offset, background, infscroll_req) {
 
                        Form.enable("main_toolbar_form");
 
-                       if (!offset)
-                               if (!is_cat) {
-                                       if (!setFeedExpandoIcon(feed, is_cat, 'images/indicator_white.gif'))
-                                               notify_progress("Loading, please wait...", true);
-                               } else {
+                       if (!offset) {
+                               if (!setFeedExpandoIcon(feed, is_cat,
+                                                       (is_cat) ? 'images/indicator_tiny.gif' : 'images/indicator_white.gif'))
                                        notify_progress("Loading, please wait...", true);
-                               }
+                       }
                }
 
                query += "&cat=" + is_cat;