From bcb8761d36eb0297d8675f6af17957f9accc5b7b Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Mon, 30 Mar 2015 17:45:25 -0400 Subject: Issue #1995058 by TravisCarden, acbramley, vbouchet: Tableselect "select all" checkbox should be checked on page load if all checkboxes are ticked --- misc/tableselect.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'misc') diff --git a/misc/tableselect.js b/misc/tableselect.js index 8f0cd9750..09bac1390 100644 --- a/misc/tableselect.js +++ b/misc/tableselect.js @@ -57,6 +57,10 @@ Drupal.tableSelect = function () { // Keep track of the last checked checkbox. lastChecked = e.target; }); + + // If all checkboxes are checked on page load, make sure the select-all one + // is checked too, otherwise keep unchecked. + updateSelectAll((checkboxes.length == $(checkboxes).filter(':checked').length)); }; Drupal.tableSelectRange = function (from, to, state) { -- cgit v1.2.3