]> git.wh0rd.org Git - tt-rss.git/commitdiff
when trying to load a feed from collapsed category, show loading indicator in categor...
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Thu, 11 Nov 2010 12:29:46 +0000 (15:29 +0300)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Thu, 11 Nov 2010 12:29:46 +0000 (15:29 +0300)
feedlist.js
viewfeed.js

index 3ae69d74acdaf77962c3b14b157065c55d8ddc3c..9032ba0269954896324761fffeb329f573ffe227 100644 (file)
@@ -287,11 +287,28 @@ function viewfeed(feed, subop, is_cat, subop_param, skip_history, offset) {
 
                                        if (!is_cat && img) {
 
-                                               if (!img.src.match("indicator_white")) {
-                                                       img.alt = img.src;
-                                                       img.src = getInitParam("sign_progress");
-                                               }
+                                               var cat_list = feedr.parentNode;
+
+                                               if (!cat_list || Element.visible(cat_list)) {
+                                                       if (!img.src.match("indicator_white")) {
+                                                               img.alt = img.src;
+                                                               img.src = getInitParam("sign_progress");
+                                                       }
+                                               } else if (cat_list) {
+                                                       feed_cat_id = cat_list.id.replace("FCATLIST-", "");
+
+                                                       if (!$('FLL-' + feed_cat_id)) {
+
+                                                               var ll = document.createElement('img');
 
+                                                               ll.src = getInitParam("sign_progress_tiny");
+                                                               ll.className = 'hlLoading';
+                                                               ll.id = 'FLL-' + feed;
+
+                                                               $("FCAP-" + feed_cat_id).appendChild(ll);
+                                                       }
+                                               } 
+                                       
                                        } else {
 
                                                if (!$('FLL-' + feed)) {
@@ -304,8 +321,8 @@ function viewfeed(feed, subop, is_cat, subop_param, skip_history, offset) {
                                                        feedr.appendChild(ll);
                                                }
                                        }
-                               }
-                       }
+                               } 
+                       }  
 
                        new Ajax.Request("backend.php", {
                                parameters: query,
@@ -362,6 +379,14 @@ function toggleCollapseCat(cat) {
        }
 }
 
+function isCatCollapsed(cat) {
+       try {
+               return Element.visible("FCATLIST-" + cat);
+       } catch (e) {
+               exception_error("isCatCollapsed", e);
+       }
+}
+
 function feedlist_dragsorted(ctr) {
        try {
                var elem = $("feedList");
index c30a2c6b076cea1ef42f98fe1e9d8ab35f8cd409..872db9a0a57d1ddb273440a1b673fa9483529e71 100644 (file)
@@ -77,21 +77,19 @@ function headlines_callback2(transport, feed_cur_page) {
 
                var ll = $('FLL-' + feed_id);
 
+               if (ll && ll.parentNode) 
+                       ll.parentNode.removeChild(ll);
+
                if (!is_cat) {
                        var feedr = $("FEEDR-" + feed_id);
                        if (feedr && !feedr.className.match("Selected")) {      
                                feedr.className = feedr.className + "Selected";
                        } 
-                       if (feedr && ll) feedr.removeChild(ll);
                } else {
                        var feedr = $("FCAT-" + feed_id);
                        if (feedr && !feedr.className.match("Selected")) {      
                                feedr.className = feedr.className + "Selected";
                        } 
-
-                       var fcap = $("FCAP-" + feed_id);
-                       if (fcap && ll) fcap.removeChild(ll);
-
                }
 
                var img = $('FIMG-' + feed_id);