Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
As the title says, this is my nitpick. The JS needs some logic to check for more two or more checkboxes in a list, then provide check all.
Comment | File | Size | Author |
---|---|---|---|
#9 | tableselect.js_.v3.patch | 1.65 KB | jrabeemer |
#7 | tableselect.js_.v2.patch | 819 bytes | jrabeemer |
#1 | tableselect.js0_.patch | 853 bytes | floretan |
Comments
Comment #1
floretan CreditAttribution: floretan commentedHere's a patch for tableselect.js that checks that a table has at least one checkbox.
In the case where there is only one row/checkbox in the table, it would also work not to add the "select all" checkbox, but the display would be less consistent without it.
Comment #2
moshe weitzman CreditAttribution: moshe weitzman commentedComment #3
Freso CreditAttribution: Freso commentedI'm a bit uncertain as to where this is an issue. Which page(s) is tableselect.js used on? (One can't test it if one doesn't know how or where to do so. :))
Comment #4
floretan CreditAttribution: floretan commentedOne of the places where this is used is on the content administration page at admin/content/node.
Comment #5
anders.fajerson CreditAttribution: anders.fajerson commentedWhat's the drawback of having it displayed? The advantage is simpler code and a consistent UI.
Comment #6
jrabeemer CreditAttribution: jrabeemer commentedThanks for the patch flobruit. We just need to verify against the different browsers against the patch with the internal themes. Once that's done, I'm sure the patch will push to head.
Comment #7
jrabeemer CreditAttribution: jrabeemer commentedThanks Flobruit. I updated the patch against HEAD and reduced the code a smidgen to remove the brackets to one line. This patch is dead simple and prevents the insertion of the checkall box into the table if there are no checkboxes. Tested against Safari 3.04 beta Windows, FF 2.0.0.9, IE7 Vista, and Opera 9.5 Alpha. Moving to RTBC.
Comment #8
Gábor HojtsyI don't think our coding guildelines allow skipping curly braces and newlines with if()s in JS files.
Comment #9
jrabeemer CreditAttribution: jrabeemer commentedNormally I would agree but if you look at the JS file, it doesn't follow that. Lines 61, 71, 74
http://cvs.drupal.org/viewvc.py/drupal/drupal/misc/tableselect.js?annota...
Here's a new patch that fixes all the brackets.
Comment #10
Gábor HojtsyGreat, committed, thanks.
Comment #11
(not verified) CreditAttribution: commentedAutomatically closed -- issue fixed for two weeks with no activity.