Preload tablesorter styles by module 'jquery.tablesorter.styles'

This change avoids the flash of missing sorting buttons while loading,
but only with I0b446d18f47428d8c0c4aed78b75de16fe106218 in MediaWiki
core included in MediaWiki 1.33 or higher.

Depends-On: I0b446d18f47428d8c0c4aed78b75de16fe106218
Change-Id: I2c3eeb3a83822798ae0c46fcfea071df706798d7
This commit is contained in:
Fomafix 2019-01-20 21:27:17 +01:00
parent b56cba7d18
commit 962a84ed82
2 changed files with 3 additions and 1 deletions

View file

@ -15,7 +15,7 @@
"license-name": "GPL-2.0-or-later", "license-name": "GPL-2.0-or-later",
"type": "parserhook", "type": "parserhook",
"requires": { "requires": {
"MediaWiki": ">= 1.32.0" "MediaWiki": ">= 1.33.0"
}, },
"APIModules": { "APIModules": {
"templatedata": "ApiTemplateData" "templatedata": "ApiTemplateData"

View file

@ -152,7 +152,9 @@ class TemplateDataHooks {
$parser->getOutput()->addModuleStyles( [ $parser->getOutput()->addModuleStyles( [
'ext.templateData', 'ext.templateData',
'ext.templateData.images', 'ext.templateData.images',
'jquery.tablesorter.styles',
] ); ] );
$parser->getOutput()->addModules( 'jquery.tablesorter' );
$parser->enableOOUI(); $parser->enableOOUI();
return $ti->getHtml( $parser->getOptions()->getUserLangObj() ); return $ti->getHtml( $parser->getOptions()->getUserLangObj() );