workaround for Uncategorized collapse state, fix pre-collapsed category display in outputFeedList

This commit is contained in:
Andrew Dolgov 2005-12-16 06:37:18 +01:00
parent 83f043bb94
commit 65f8581478
2 changed files with 16 additions and 2 deletions

View File

@ -450,11 +450,19 @@
$collapsed = $line["collapsed"]; $collapsed = $line["collapsed"];
// workaround for NULL category
if ($category == "Uncategorized") {
if ($_COOKIE["ttrss_vf_uclps"] == 1) {
$collapsed = "t";
}
}
if ($collapsed == "t" || $collapsed == "1") { if ($collapsed == "t" || $collapsed == "1") {
$holder_class = "invisible"; $holder_class = "invisible";
$tmp_category .= "..."; $ellipsis = "...";
} else { } else {
$holder_class = ""; $holder_class = "";
$ellipsis = "";
} }
if ($cat_id) { if ($cat_id) {
@ -476,7 +484,7 @@
print "<li class=\"feedCat\" id=\"FCAT-$cat_id\"> print "<li class=\"feedCat\" id=\"FCAT-$cat_id\">
<a href=\"javascript:toggleCollapseCat($cat_id)\">$tmp_category <a href=\"javascript:toggleCollapseCat($cat_id)\">$tmp_category
<span id=\"FCATCTR-$cat_id\" <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 // !!! NO SPACE before <ul...feedCatList - breaks firstChild DOM function
// -> keyboard navigation, etc. // -> keyboard navigation, etc.

View File

@ -170,9 +170,15 @@ function toggleCollapseCat(cat) {
if (cat_list.className.match("invisible")) { if (cat_list.className.match("invisible")) {
cat_list.className = ""; cat_list.className = "";
caption.innerHTML = caption.innerHTML.replace("...", ""); caption.innerHTML = caption.innerHTML.replace("...", "");
if (cat == 0) {
setCookie("ttrss_vf_uclps", "0");
}
} else { } else {
cat_list.className = "invisible"; cat_list.className = "invisible";
caption.innerHTML = caption.innerHTML + "..."; caption.innerHTML = caption.innerHTML + "...";
if (cat == 0) {
setCookie("ttrss_vf_uclps", "1");
}
} }
xmlhttp_rpc.open("GET", "backend.php?op=feeds&subop=collapse&cid=" + xmlhttp_rpc.open("GET", "backend.php?op=feeds&subop=collapse&cid=" +