diff --git a/core/misc/tableselect.js b/core/misc/tableselect.js index fb82ec0..0a4cc60 100644 --- a/core/misc/tableselect.js +++ b/core/misc/tableselect.js @@ -14,8 +14,11 @@ */ Drupal.behaviors.tableSelect = { attach: function (context, settings) { - // Select the inner-most table in case of nested tables. - $(context).find('th.select-all').closest('table').once('table-select').each(Drupal.tableSelect); + // Select the inner-most table in case of nested tables. Append tables + // with attribute 'data-drupal-select-all' to collection. + $(context).find('th.select-all').closest('table') + .add('[data-drupal-select-all]') + .once('table-select').each(Drupal.tableSelect); } }; @@ -118,15 +121,21 @@ // Traverse through the sibling nodes. for (var i = from[mode]; i; i = i[mode]) { var $i; + var $checkbox; // Make sure that we're only dealing with elements. if (i.nodeType !== 1) { continue; } $i = $(i); + $checkbox = $i.find('input[type="checkbox"]'); + // Skip disabled elements for visual coherence. + if ($checkbox.prop('disabled')) { + continue; + } // Either add or remove the selected class based on the state of the // target checkbox. $i.toggleClass('selected', state); - $i.find('input[type="checkbox"]').prop('checked', state); + $checkbox.prop('checked', state); if (to.nodeType) { // If we are at the end of the range, stop. diff --git a/core/modules/system/src/Form/ModulesListForm.php b/core/modules/system/src/Form/ModulesListForm.php index e8a6cea..36ed28d 100644 --- a/core/modules/system/src/Form/ModulesListForm.php +++ b/core/modules/system/src/Form/ModulesListForm.php @@ -180,6 +180,7 @@ public function buildForm(array $form, FormStateInterface $form_state) { // Lastly, sort all packages by title. uasort($form['modules'], array('\Drupal\Component\Utility\SortArray', 'sortByTitleProperty')); + $form['#attached']['library'][] = 'core/drupal.tableselect'; $form['#attached']['library'][] = 'system/drupal.system.modules'; $form['actions'] = array('#type' => 'actions'); $form['actions']['submit'] = array( diff --git a/core/modules/system/src/Form/ModulesUninstallForm.php b/core/modules/system/src/Form/ModulesUninstallForm.php index c59b146..281da99 100644 --- a/core/modules/system/src/Form/ModulesUninstallForm.php +++ b/core/modules/system/src/Form/ModulesUninstallForm.php @@ -156,6 +156,7 @@ public function buildForm(array $form, FormStateInterface $form_state) { } } + $form['#attached']['library'][] = 'core/drupal.tableselect'; $form['#attached']['library'][] = 'system/drupal.system.modules'; $form['actions'] = array('#type' => 'actions'); $form['actions']['submit'] = array( diff --git a/core/modules/system/templates/system-modules-details.html.twig b/core/modules/system/templates/system-modules-details.html.twig index e431c8e..754d2dc 100644 --- a/core/modules/system/templates/system-modules-details.html.twig +++ b/core/modules/system/templates/system-modules-details.html.twig @@ -24,7 +24,7 @@ * @ingroup themeable */ #} - +
diff --git a/core/modules/system/templates/system-modules-uninstall.html.twig b/core/modules/system/templates/system-modules-uninstall.html.twig index 180ca08..1c0dd74 100644 --- a/core/modules/system/templates/system-modules-uninstall.html.twig +++ b/core/modules/system/templates/system-modules-uninstall.html.twig @@ -23,7 +23,7 @@ #} {{ form.filters }} -
{{ 'Installed'|t }}
+
diff --git a/core/themes/stable/templates/admin/system-modules-details.html.twig b/core/themes/stable/templates/admin/system-modules-details.html.twig index 618b58a..35397a5 100644 --- a/core/themes/stable/templates/admin/system-modules-details.html.twig +++ b/core/themes/stable/templates/admin/system-modules-details.html.twig @@ -22,7 +22,7 @@ * @see template_preprocess_system_modules_details() */ #} -
{{ 'Uninstall'|t }}
+
diff --git a/core/themes/stable/templates/admin/system-modules-uninstall.html.twig b/core/themes/stable/templates/admin/system-modules-uninstall.html.twig index 3556709..37675b6 100644 --- a/core/themes/stable/templates/admin/system-modules-uninstall.html.twig +++ b/core/themes/stable/templates/admin/system-modules-uninstall.html.twig @@ -21,7 +21,7 @@ #} {{ form.filters }} -
{{ 'Installed'|t }}
+
{{ 'Uninstall'|t }}