]> git.wh0rd.org - tt-rss.git/commitdiff
workaround for Uncategorized collapse state, fix pre-collapsed category display in...
authorAndrew Dolgov <fox@madoka.spb.ru>
Fri, 16 Dec 2005 05:37:18 +0000 (06:37 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Fri, 16 Dec 2005 05:37:18 +0000 (06:37 +0100)
backend.php
feedlist.js

index 024eab305a52d78558c9871d5649b325e39e8ffd..ec1ffcc20247e759dbbe20732fdb2fd9a1028be8 100644 (file)
 
                                        $collapsed = $line["collapsed"];
 
+                                       // workaround for NULL category
+                                       if ($category == "Uncategorized") {
+                                               if ($_COOKIE["ttrss_vf_uclps"] == 1) {
+                                                       $collapsed = "t";
+                                               }
+                                       }
+
                                        if ($collapsed == "t" || $collapsed == "1") {
                                                $holder_class = "invisible";
-                                               $tmp_category .= "...";
+                                               $ellipsis = "...";
                                        } else {
                                                $holder_class = "";
+                                               $ellipsis = "";
                                        }
 
                                        if ($cat_id) {
                                        print "<li class=\"feedCat\" id=\"FCAT-$cat_id\">
                                                <a href=\"javascript:toggleCollapseCat($cat_id)\">$tmp_category
                                                        <span id=\"FCATCTR-$cat_id\" 
-                                                       class=\"$catctr_class\">($cat_unread unread)</span></a></li>";
+                                                       class=\"$catctr_class\">($cat_unread unread)$ellipsis</span></a></li>";
 
                                        // !!! NO SPACE before <ul...feedCatList - breaks firstChild DOM function
                                        // -> keyboard navigation, etc.
index e9310837958da8fc12327a768377ebc3b84f7661..5265266438061f7b82fb6dbf93eedc8dbd3c101a 100644 (file)
@@ -170,9 +170,15 @@ function toggleCollapseCat(cat) {
                if (cat_list.className.match("invisible")) {
                        cat_list.className = "";
                        caption.innerHTML = caption.innerHTML.replace("...", "");
+                       if (cat == 0) {
+                               setCookie("ttrss_vf_uclps", "0");
+                       }
                } else {
                        cat_list.className = "invisible";
                        caption.innerHTML = caption.innerHTML + "...";
+                       if (cat == 0) {
+                               setCookie("ttrss_vf_uclps", "1");
+                       }
                }
 
                xmlhttp_rpc.open("GET", "backend.php?op=feeds&subop=collapse&cid=" +