summaryrefslogtreecommitdiff
path: root/functions.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2005-11-25 16:38:08 +0100
committerAndrew Dolgov <[email protected]>2005-11-25 16:38:08 +0100
commit4f3a84f4d336a6d9bb1172873a063ff8a8b390ec (patch)
treed9620e507653d1f5aa326f05772a7200b7484da8 /functions.js
parent35f3c923c47a94af018ff2b41d8c37a5956a9d37 (diff)
cleaned up unread/selected style mess
Diffstat (limited to 'functions.js')
-rw-r--r--functions.js18
1 files changed, 14 insertions, 4 deletions
diff --git a/functions.js b/functions.js
index c03e623f2..83246bfda 100644
--- a/functions.js
+++ b/functions.js
@@ -328,11 +328,11 @@ if (!xmlhttp_rpc && typeof XMLHttpRequest!='undefined') {
xmlhttp_rpc = new XMLHttpRequest();
}
-function label_counters_callback() {
+function all_counters_callback() {
if (xmlhttp_rpc.readyState == 4) {
if (!xmlhttp_rpc.responseXML) {
- notify("label_counters_callback: backend did not return valid XML");
+ notify("[all_counters_callback] backend did not return valid XML");
return;
}
@@ -355,7 +355,17 @@ function label_counters_callback() {
if (ctr > 0) {
feedctr.className = "odd";
if (!feedr.className.match("Unread")) {
+ var is_selected = feedr.className.match("Selected");
+
+ feedr.className = feedr.className.replace("Selected", "");
+ feedr.className = feedr.className.replace("Unread", "");
+
feedr.className = feedr.className + "Unread";
+
+ if (is_selected) {
+ feedr.className = feedr.className + "Selected";
+ }
+
}
} else {
feedctr.className = "invisible";
@@ -366,7 +376,7 @@ function label_counters_callback() {
}
}
-function update_label_counters(feed) {
+function update_all_counters(feed) {
if (xmlhttp_ready(xmlhttp_rpc)) {
var query = "backend.php?op=rpc&subop=getAllCounters";
@@ -375,7 +385,7 @@ function update_label_counters(feed) {
}
xmlhttp_rpc.open("GET", query, true);
- xmlhttp_rpc.onreadystatechange=label_counters_callback;
+ xmlhttp_rpc.onreadystatechange=all_counters_callback;
xmlhttp_rpc.send(null);
}
}