fix updating of unread counters in feedlist on headlines load
This commit is contained in:
parent
c80e217587
commit
0c67440670
23
backend.php
23
backend.php
|
@ -106,11 +106,15 @@
|
||||||
}
|
}
|
||||||
print "<span id=\"FEEDN-$feed_id\">$feed</span>";
|
print "<span id=\"FEEDN-$feed_id\">$feed</span>";
|
||||||
|
|
||||||
if ($unread > 0) {
|
if ($unread != 0) {
|
||||||
print "<span id=\"FEEDCTR-$feed_id\">
|
$fctr_class = "";
|
||||||
(<span id=\"FEEDU-$feed_id\">$unread</span>)</span>";
|
} else {
|
||||||
|
$fctr_class = "class=\"invisible\"";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print "<span $fctr_class id=\"FEEDCTR-$feed_id\">
|
||||||
|
(<span id=\"FEEDU-$feed_id\">$unread</span>)</span>";
|
||||||
|
|
||||||
print "</li>";
|
print "</li>";
|
||||||
|
|
||||||
++$lnum;
|
++$lnum;
|
||||||
|
@ -456,19 +460,24 @@
|
||||||
var p_document = parent.frames['feeds-frame'].document;
|
var p_document = parent.frames['feeds-frame'].document;
|
||||||
|
|
||||||
var feedr = p_document.getElementById(\"FEEDR-\" + $feed);
|
var feedr = p_document.getElementById(\"FEEDR-\" + $feed);
|
||||||
var feedt = p_document.getElementById(\"FEEDT-\" + $feed);
|
|
||||||
var feedu = p_document.getElementById(\"FEEDU-\" + $feed);
|
var feedu = p_document.getElementById(\"FEEDU-\" + $feed);
|
||||||
|
|
||||||
feedt.innerHTML = \"$total\";
|
if (feedu) {
|
||||||
feedu.innerHTML = \"$unread\";
|
feedu.innerHTML = \"$unread\";
|
||||||
|
}
|
||||||
|
|
||||||
|
var feedctr = p_document.getElementById(\"FEEDCTR-\" + $feed);
|
||||||
|
|
||||||
if ($unread > 0 && !feedr.className.match(\"Unread\")) {
|
if ($unread > 0 && !feedr.className.match(\"Unread\")) {
|
||||||
feedr.className = feedr.className + \"Unread\";
|
feedr.className = feedr.className + \"Unread\";
|
||||||
|
feedctr.className = '';
|
||||||
} else if ($unread <= 0) {
|
} else if ($unread <= 0) {
|
||||||
feedr.className = feedr.className.replace(\"Unread\", \"\");
|
feedr.className = feedr.className.replace(\"Unread\", \"\");
|
||||||
|
feedctr.className = 'invisible';
|
||||||
}
|
}
|
||||||
|
|
||||||
//p_notify('');
|
p_notify(\"\");
|
||||||
|
|
||||||
</script>";
|
</script>";
|
||||||
|
|
||||||
if ($addheader) {
|
if ($addheader) {
|
||||||
|
|
|
@ -128,7 +128,8 @@ ul.feedList li {
|
||||||
}
|
}
|
||||||
|
|
||||||
ul.feedList li.oddSelected, ul.feedList li.evenSelected,
|
ul.feedList li.oddSelected, ul.feedList li.evenSelected,
|
||||||
li.oddUnreadSelected, li.evenUnreadSelected {
|
li.oddUnreadSelected, li.evenUnreadSelected, li.evenSelectedUnread,
|
||||||
|
li.oddSelectedUnread {
|
||||||
background-color : white;
|
background-color : white;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ if (!xmlhttp_rpc && typeof XMLHttpRequest!='undefined') {
|
||||||
|
|
||||||
function view(id, feed_id) {
|
function view(id, feed_id) {
|
||||||
|
|
||||||
// p_notify("Loading article...");
|
p_notify("Loading article...");
|
||||||
|
|
||||||
enableHotkeys();
|
enableHotkeys();
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ function view(id, feed_id) {
|
||||||
var feedctr = f_doc.getElementById("FEEDCTR-" + feed_id);
|
var feedctr = f_doc.getElementById("FEEDCTR-" + feed_id);
|
||||||
|
|
||||||
if (feedctr) {
|
if (feedctr) {
|
||||||
feedctr.innerHTML = "";
|
feedctr.className = "invisible";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue