sortable tables/mw-collapsible no longer causes page jump
[lhc/web/wiklou.git] / includes / skins / Skin.php
index 9c4ac50..2247cc2 100644 (file)
@@ -179,7 +179,9 @@ abstract class Skin extends ContextSource {
                        // Styles key sets render blocking styles
                        // Unlike other keys in this definition it is an associative array
                        // where each key is the group name and points to a list of modules
-                       'styles' => [],
+                       'styles' => [
+                               'content' => [],
+                       ],
                        // modules not specific to any specific skin or page
                        'core' => [
                                // Enforce various default modules for all pages and all skins
@@ -208,11 +210,13 @@ abstract class Skin extends ContextSource {
                // Preload jquery.tablesorter for mediawiki.page.ready
                if ( strpos( $out->getHTML(), 'sortable' ) !== false ) {
                        $modules['content'][] = 'jquery.tablesorter';
+                       $modules['styles']['content'][] = 'jquery.tablesorter.styles';
                }
 
                // Preload jquery.makeCollapsible for mediawiki.page.ready
                if ( strpos( $out->getHTML(), 'mw-collapsible' ) !== false ) {
                        $modules['content'][] = 'jquery.makeCollapsible';
+                       $modules['styles']['content'][] = 'jquery.makeCollapsible.styles';
                }
 
                if ( $out->isTOCEnabled() ) {