Issue #1319420 by nod_: Fixed multiple execution of tableselect.js with nested tables.
authorwebchick
Tue, 14 Feb 2012 18:52:40 +0000 (13:52 -0500)
committerwebchick
Tue, 14 Feb 2012 18:52:40 +0000 (13:52 -0500)
misc/tableselect.js

index 8cf7f36..f201a88 100644 (file)
@@ -2,7 +2,8 @@
 
 Drupal.behaviors.tableSelect = {
   attach: function (context, settings) {
-    $('table:has(th.select-all)', context).once('table-select', Drupal.tableSelect);
+    // Select the inner-most table in case of nested tables.
+    $('th.select-all', context).closest('table').once('table-select', Drupal.tableSelect);
   }
 };