Load 'mediawiki.page.gallery.styles' also without javascript
authorumherirrender <umherirrender_de.wp@web.de>
Sat, 31 Oct 2015 12:49:11 +0000 (13:49 +0100)
committerUmherirrender <umherirrender_de.wp@web.de>
Sat, 31 Oct 2015 17:33:15 +0000 (17:33 +0000)
Using OutputPage::addModules lets the style loaded over javascript
Using OutputPage::addModuleStyles forces loading over css

Follows I32697c2c65824d7622c1840330d6074ebb68b488

Bug: T117328
Change-Id: I3ddf105d180336b6eb7ae31286221151055e649f

includes/gallery/TraditionalImageGallery.php

index 0934f6a..181c7b8 100644 (file)
@@ -46,12 +46,13 @@ class TraditionalImageGallery extends ImageGalleryBase {
                        array( 'class' => 'gallery mw-gallery-' . $this->mMode ), $this->mAttribs );
 
                $modules = $this->getModules();
-               $modules[] = 'mediawiki.page.gallery.styles';
 
                if ( $this->mParser ) {
                        $this->mParser->getOutput()->addModules( $modules );
+                       $this->mParser->getOutput()->addModuleStyles( 'mediawiki.page.gallery.styles' );
                } else {
                        $this->getOutput()->addModules( $modules );
+                       $this->getOutput()->addModuleStyles( 'mediawiki.page.gallery.styles' );
                }
                $output = Xml::openElement( 'ul', $attribs );
                if ( $this->mCaption ) {