From 649e0af9feecfb58c064addd8ee2fb7568ac45c8 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 29 Dec 2005 15:31:20 +0100 Subject: [PATCH] Select unread should clear previous selection (closes #19) --- backend.php | 4 ++-- functions.js | 18 +++++++++++------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/backend.php b/backend.php index 0efb48273..e53b657b3 100644 --- a/backend.php +++ b/backend.php @@ -1273,9 +1273,9 @@ print " Select: All, + 'RROW-', 'RCHK-', true, '', true)\">All, Unread, + 'RROW-', 'RCHK-', true, 'Unread', true)\">Unread, None    diff --git a/functions.js b/functions.js index e408fb8d7..b75da2bd2 100644 --- a/functions.js +++ b/functions.js @@ -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); } } }