Skip to content

Commit

Permalink
Avoid CSS FOUC (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
mwjames committed Nov 27, 2016
1 parent 37262a7 commit 492eab0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
14 changes: 13 additions & 1 deletion SemanticBreadcrumbLinks.php
Expand Up @@ -60,14 +60,26 @@ public static function initExtension() {
$GLOBALS['wgMessagesDirs']['SemanticBreadcrumbLinks'] = __DIR__ . '/i18n';

// Register resource files
$GLOBALS['wgResourceModules']['ext.semanticbreadcrumblinks'] = array(
$GLOBALS['wgResourceModules']['ext.semanticbreadcrumblinks.styles'] = array(
'styles' => 'res/sbl.styles.css',
'localBasePath' => __DIR__ ,
'remoteExtPath' => 'SemanticBreadcrumbLinks',
'position' => 'top',
'group' => 'ext.smw',
'targets' => array(
'mobile',
'desktop'
)
);

$GLOBALS['wgResourceModules']['ext.semanticbreadcrumblinks'] = array(
'scripts' => 'res/sbl.tooltip.js',
'localBasePath' => __DIR__ ,
'remoteExtPath' => 'SemanticBreadcrumbLinks',
'position' => 'top',
'group' => 'ext.smw',
'dependencies' => array(
'ext.semanticbreadcrumblinks.styles',
'onoi.qtip'
),
'targets' => array(
Expand Down
3 changes: 1 addition & 2 deletions src/PageDisplayOutputModifier.php
Expand Up @@ -50,8 +50,7 @@ public function setSubpageByNamespace( array $subpageByNamespace ) {
*/
public function modifyOutput( OutputPage $outputPage ) {

// #21
// $outputPage->addModuleStyles( 'ext.semanticbreadcrumblinks' );
$outputPage->addModuleStyles( 'ext.semanticbreadcrumblinks.styles' );
$outputPage->addModules( 'ext.semanticbreadcrumblinks' );

if ( !$this->hideSubpageParentState || !$this->hasSubpageEnabledNamespace( $outputPage->getTitle()->getNamespace() ) ) {
Expand Down

0 comments on commit 492eab0

Please sign in to comment.