]> git.wh0rd.org Git - tt-rss.git/commitdiff
Select unread should clear previous selection (closes #19)
authorAndrew Dolgov <fox@bah.spb.su>
Thu, 29 Dec 2005 14:31:20 +0000 (15:31 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Thu, 29 Dec 2005 14:31:20 +0000 (15:31 +0100)
backend.php
functions.js

index 0efb48273015d8efc10b397c4e22f6675975f114..e53b657b32d5b5f9feb1efaee9885071b8313ee6 100644 (file)
                                print "<td class=\"headlineActions\">
                                        Select: 
                                                                <a href=\"javascript:selectTableRowsByIdPrefix('headlinesList', 
-                                                                       'RROW-', 'RCHK-', true)\">All</a>,
+                                                                       'RROW-', 'RCHK-', true, '', true)\">All</a>,
                                                                <a href=\"javascript:selectTableRowsByIdPrefix('headlinesList', 
-                                                                       'RROW-', 'RCHK-', true, 'Unread')\">Unread</a>,
+                                                                       'RROW-', 'RCHK-', true, 'Unread', true)\">Unread</a>,
                                                                <a href=\"javascript:selectTableRowsByIdPrefix('headlinesList', 
                                                                        'RROW-', 'RCHK-', false)\">None</a>
                                                &nbsp;&nbsp;
index e408fb8d7c10b52fed8dadec3729c81f591a585c..b75da2bd207574bbea34a7c06959c57d4185895b 100644 (file)
@@ -557,7 +557,7 @@ function selectTableRowById(elem_id, check_id, do_select) {
 }
 
 function selectTableRowsByIdPrefix(content_id, prefix, check_prefix, do_select, 
-       classcheck) {
+       classcheck, reset_others) {
 
        var content = document.getElementById(content_id);
 
@@ -571,14 +571,18 @@ function selectTableRowsByIdPrefix(content_id, prefix, check_prefix, do_select,
        
                        if (content.rows[i].id.match(prefix)) {
                                selectTableRow(content.rows[i], do_select);
-                       }
-
-                       var row_id = content.rows[i].id.replace(prefix, "");
-                       var check = document.getElementById(check_prefix + row_id);
+                       
+                               var row_id = content.rows[i].id.replace(prefix, "");
+                               var check = document.getElementById(check_prefix + row_id);
 
-                       if (check) {
-                               check.checked = do_select;
+                               if (check) {
+                                       check.checked = do_select;
+                               }
+                       } else if (reset_others) {
+                               selectTableRow(content.rows[i], false);
                        }
+               } else if (reset_others) {
+                       selectTableRow(content.rows[i], false);
                }
        }
 }