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' ); }