]> git.wh0rd.org Git - tt-rss.git/commitdiff
feedlist display fixes for category mode
authorAndrew Dolgov <fox@madoka.spb.ru>
Wed, 23 Nov 2005 07:41:36 +0000 (08:41 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Wed, 23 Nov 2005 07:41:36 +0000 (08:41 +0100)
backend.php
functions.js

index 28e636a4200aa69626f4cc5be7f08b69fca7e9df..8987f627cf1399b6fdda00ea522ea761d7d1ecdf 100644 (file)
 
                        if (get_pref($link, 'ENABLE_FEED_CATS')) {
                                print "<li class=\"feedCat\">Special</li>";
-                               print "<ul class=\"feedCatList\">";
+                               print "<li id=\"feedCatHolder\"><ul class=\"feedCatList\">";
                        }
 
                        $result = db_query($link, "SELECT count(id) as num_starred 
                                "images/mark_set.png", $link);
 
                        if (get_pref($link, 'ENABLE_FEED_CATS')) {
-                               print "</ul>";
+                               print "</li></ul>";
                        }
 
                        if (get_pref($link, 'ENABLE_LABELS')) {
                                if (db_num_rows($result) > 0) {
                                        if (get_pref($link, 'ENABLE_FEED_CATS')) {
                                                print "<li class=\"feedCat\">Labels</li>";
-                                               print "<ul class=\"feedCatList\">";
+                                               print "<li id=\"feedCatHolder\"><ul class=\"feedCatList\">";
                                        } else {
                                                print "<li><hr></li>";
                                        }
 
                                if (db_num_rows($result) > 0) {
                                        if (get_pref($link, 'ENABLE_FEED_CATS')) {
-                                               print "</ul>";
+                                               print "</li></ul>";
                                        }
                                }
 
                                        $category = $tmp_category;
                                        
                                        print "<li class=\"feedCat\">$category</li>";
-                                       print "<li><ul class=\"feedCatList\">";
+                                       print "<li id=\"feedCatHolder\"><ul class=\"feedCatList\">";
                                }
        
                                printFeedEntry($feed_id, $class, $feed, $unread, 
index c7f1b8a64860517a35a21523c97c613907a4df13..6aaea8d8e80f298154a5b3f50abbeed80e3aec45 100644 (file)
@@ -126,11 +126,25 @@ function hotkey_handler(e) {
 function cleanSelectedList(element) {
        var content = document.getElementById(element);
 
-       for (i = 0; i < content.childNodes.length; i++) {
-               content.childNodes[i].className = 
-                       content.childNodes[i].className.replace("Selected", "");
-       }
+       if (!document.getElementById("feedCatHolder")) {
+               for (i = 0; i < content.childNodes.length; i++) {
+                       var child = content.childNodes[i];
+                       child.className = child.className.replace("Selected", "");
+               }
+       } else {
+               for (i = 0; i < content.childNodes.length; i++) {
+                       var child = content.childNodes[i];
+
+                       if (child.id == "feedCatHolder") {
+                               var fcat = child.firstChild;
+                               for (j = 0; j < fcat.childNodes.length; j++) {
+                                       var feed = fcat.childNodes[j];
+                                       feed.className = feed.className.replace("Selected", "");
+                               }               
+                       }
+               }
 
+       }
 }