From 4383d6d5983f131c0a4636ea7a0df1bcf03123fe Mon Sep 17 00:00:00 2001 From: John Du Hart Date: Wed, 8 Feb 2012 14:07:10 +0000 Subject: [PATCH] Followup r98500, fixes flash of unstyled content --- CategoryTree.php | 12 +++++++++--- CategoryTreeFunctions.php | 3 ++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/CategoryTree.php b/CategoryTree.php index 108c32a3..0eb8074a 100644 --- a/CategoryTree.php +++ b/CategoryTree.php @@ -139,10 +139,12 @@ $wgAjaxExportList[] = 'efCategoryTreeAjaxWrapper'; /** * Register ResourceLoader modules */ -$wgResourceModules['ext.categoryTree'] = array( +$commonModuleInfo = array( 'localBasePath' => dirname( __FILE__ ) . '/modules', 'remoteExtPath' => 'CategoryTree/modules', - 'styles' => 'ext.categoryTree.css', +); + +$wgResourceModules['ext.categoryTree'] = array( 'scripts' => 'ext.categoryTree.js', 'messages' => array( 'categorytree-collapse', @@ -158,7 +160,11 @@ $wgResourceModules['ext.categoryTree'] = array( 'categorytree-error', 'categorytree-retry', ), -); +) + $commonModuleInfo; + +$wgResourceModules['ext.categoryTree.css'] = array( + 'styles' => 'ext.categoryTree.css', +) + $commonModuleInfo; /** * Hook it up diff --git a/CategoryTreeFunctions.php b/CategoryTreeFunctions.php index 0456294f..5034be88 100644 --- a/CategoryTreeFunctions.php +++ b/CategoryTreeFunctions.php @@ -161,7 +161,8 @@ class CategoryTree { * @param OutputPage $outputPage */ static function setHeaders( $outputPage ) { - # Add the module + # Add the modules + $outputPage->addModuleStyles( 'ext.categoryTree.css' ); $outputPage->addModules( 'ext.categoryTree' ); }