]> git.wh0rd.org Git - tt-rss.git/commitdiff
fix updating of unread counters in feedlist on headlines load
authorAndrew Dolgov <fox@madoka.spb.ru>
Wed, 7 Sep 2005 07:47:10 +0000 (08:47 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Wed, 7 Sep 2005 07:47:10 +0000 (08:47 +0100)
backend.php
tt-rss.css
viewfeed.js

index 50d316b66cb46cf663485e9b2ea205504a27f973..bf8394b0b25c05d8c809fab8509906fbae437d8b 100644 (file)
                        }
                        print "<span id=\"FEEDN-$feed_id\">$feed</span>";
 
-                       if ($unread > 0) {
-                               print "<span id=\"FEEDCTR-$feed_id\">
-                                       &nbsp;(<span id=\"FEEDU-$feed_id\">$unread</span>)</span>";
+                       if ($unread != 0) {
+                               $fctr_class = "";
+                       } else {
+                               $fctr_class = "class=\"invisible\"";
                        }
+
+                       print "<span $fctr_class id=\"FEEDCTR-$feed_id\">
+                                (<span id=\"FEEDU-$feed_id\">$unread</span>)</span>";
                        
                        print "</li>";
 
                        var p_document = parent.frames['feeds-frame'].document;
 
                        var feedr = p_document.getElementById(\"FEEDR-\" + $feed);
-                       var feedt = p_document.getElementById(\"FEEDT-\" + $feed);
                        var feedu = p_document.getElementById(\"FEEDU-\" + $feed);
 
-                       feedt.innerHTML = \"$total\";
-                       feedu.innerHTML = \"$unread\";
+                       if (feedu) {
+                               feedu.innerHTML = \"$unread\";
+                       }
+
+                       var feedctr = p_document.getElementById(\"FEEDCTR-\" + $feed);
 
                        if ($unread > 0 && !feedr.className.match(\"Unread\")) {
                                        feedr.className = feedr.className + \"Unread\";
+                                       feedctr.className = '';
                        } else if ($unread <= 0) {      
                                        feedr.className = feedr.className.replace(\"Unread\", \"\");
+                                       feedctr.className = 'invisible';
                        }       
 
-                       //p_notify('');
+                       p_notify(\"\");
+
                </script>";
 
                if ($addheader) {
index 40d959d7da5562668188a18c2240625943886070..f3113b1bff594aa10c98c47e99f072c451ebce87 100644 (file)
@@ -128,7 +128,8 @@ ul.feedList li {
 }
 
 ul.feedList li.oddSelected, ul.feedList li.evenSelected,
-       li.oddUnreadSelected, li.evenUnreadSelected {
+       li.oddUnreadSelected, li.evenUnreadSelected, li.evenSelectedUnread,
+       li.oddSelectedUnread {
        background-color : white;
 } 
 
index 85963dfebf03e9c5ebc576ac9c5f9f9661c3c419..1fade859858a5dd39b7d4dfbb0af36fc6ff4815b 100644 (file)
@@ -25,7 +25,7 @@ if (!xmlhttp_rpc && typeof XMLHttpRequest!='undefined') {
 
 function view(id, feed_id) {
 
-//     p_notify("Loading article...");
+       p_notify("Loading article...");
 
        enableHotkeys();
 
@@ -46,7 +46,7 @@ function view(id, feed_id) {
                        var feedctr = f_doc.getElementById("FEEDCTR-" + feed_id);
 
                        if (feedctr) {
-                               feedctr.innerHTML = "";
+                               feedctr.className = "invisible";
                        }
                }