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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

floretan’s picture

Assigned: Unassigned » floretan
Status: Active » Needs review
FileSize
853 bytes

Here'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.

moshe weitzman’s picture

Priority: Normal » Minor
Freso’s picture

I'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. :))

floretan’s picture

One of the places where this is used is on the content administration page at admin/content/node.

anders.fajerson’s picture

What's the drawback of having it displayed? The advantage is simpler code and a consistent UI.

jrabeemer’s picture

Thanks 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.

jrabeemer’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
819 bytes

Thanks 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.

Gábor Hojtsy’s picture

Status: Reviewed & tested by the community » Needs work

I don't think our coding guildelines allow skipping curly braces and newlines with if()s in JS files.

jrabeemer’s picture

FileSize
1.65 KB

Normally 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.

Gábor Hojtsy’s picture

Status: Needs work » Fixed

Great, committed, thanks.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.