]> git.wh0rd.org Git - tt-rss.git/commitdiff
toggleUnread: properly handle cmode
authorAndrew Dolgov <fox@madoka.spb.ru>
Thu, 18 Oct 2007 03:00:18 +0000 (04:00 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Thu, 18 Oct 2007 03:00:18 +0000 (04:00 +0100)
viewfeed.js

index 24584e49fc376317d6c39621de9f863b31a008bf..be790020444bd5f4e5f5e081a311f3203fbf34aa 100644 (file)
@@ -653,13 +653,19 @@ function toggleUnread(id, cmode) {
                        nc = nc.replace("Unread", "");
                        nc = nc.replace("Selected", "");
 
-                       if (row.className.match("Unread")) {
+                       if (cmode == undefined || cmode == 2) {
+                               if (row.className.match("Unread")) {
+                                       row.className = nc;
+                               } else {
+                                       row.className = nc + "Unread";
+                               }
+                       } else if (cmode == 0) {
                                row.className = nc;
-                       } else {
+                       } else if (cmode == 1) {
                                row.className = nc + "Unread";
                        }
 
-                       if (!cmode) cmode = 2;
+                       if (cmode == undefined) cmode = 2;
 
                        var query = "backend.php?op=rpc&subop=catchupSelected&ids=" +
                                param_escape(id) + "&cmode=" + param_escape(cmode);