From a5b815903df28ce23498639406b44ad9ca24b2be Mon Sep 17 00:00:00 2001 From: Func Date: Fri, 31 Mar 2023 01:22:36 +0800 Subject: [PATCH] Remove jquery.tablesorter modules form the dequeue list Preload via Skin::getDefaultModules() should be allowed to avoid the separate load request in a fresh environment. Also, cleanup the code and comments, 'sortable' => true is the default, no need to specify again. Bug: T233340 Change-Id: Icc04d2cd2dc85efab64e5c8de68e606cfad61480 --- includes/Hooks.php | 3 +-- includes/Skins/SkinMinerva.php | 12 ++++-------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/includes/Hooks.php b/includes/Hooks.php index e27754ac4..abeeb9b26 100644 --- a/includes/Hooks.php +++ b/includes/Hooks.php @@ -405,7 +405,7 @@ class Hooks implements /** * SkinPageReadyConfig hook handler * - * Disable collapsible and sortable on page load + * Disable collapsible on page load * * @param Context $context * @param mixed[] &$config Associative array of configurable options @@ -417,7 +417,6 @@ class Hooks implements if ( $context->getSkin() === 'minerva' ) { $config['search'] = false; $config['collapsible'] = false; - $config['sortable'] = true; $config['selectorLogoutLink'] = 'a.menu__item--logout[data-mw="interface"]'; } } diff --git a/includes/Skins/SkinMinerva.php b/includes/Skins/SkinMinerva.php index b6ebb93c7..906dae3f9 100644 --- a/includes/Skins/SkinMinerva.php +++ b/includes/Skins/SkinMinerva.php @@ -862,15 +862,13 @@ class SkinMinerva extends SkinMustache { $modules = parent::getDefaultModules(); // FIXME: T223204: Dequeue default content modules except for the history - // action. Allow default history action content modules - // in order to enable toggling of the - // filters. Long term this won't be necessary when T111565 is resolved and a + // action. Allow default content modules on history action in order to + // enable toggling of the filters. + // Long term this won't be necessary when T111565 is resolved and a // more general solution can be used. if ( $this->getContext()->getActionName() !== 'history' ) { - // dequeue default content modules (toc, sortable, collapsible, etc.) + // dequeue default content modules (toc, collapsible, etc.) $modules['content'] = array_diff( $modules['content'], [ - // T233340 - 'jquery.tablesorter', // T111565 'jquery.makeCollapsible', // Minerva provides its own implementation. Loading this will break display. @@ -878,8 +876,6 @@ class SkinMinerva extends SkinMustache { ] ); // dequeue styles associated with `content` key. $modules['styles']['content'] = array_diff( $modules['styles']['content'], [ - // T233340 - 'jquery.tablesorter.styles', // T111565 'jquery.makeCollapsible.styles', ] );