Add `showThumbnails` option to slideshow galleries
authorpppery <mapreader@olum.org>
Sat, 17 Dec 2016 02:11:12 +0000 (21:11 -0500)
committerPppery <mapreader@olum.org>
Tue, 20 Dec 2016 20:07:14 +0000 (20:07 +0000)
This option causes the thumbnail images for the slideshow to be visible
as soon as the slideshow is loaded. They can still be closed normally.`

Bug: T147913
Change-Id: Iae6fd4f016d9fc98280d4ba92e4332ff06e1fb9e

includes/gallery/SlideshowImageGallery.php
resources/src/mediawiki/page/gallery-slideshow.js

index 3f0c932..f29c565 100644 (file)
@@ -34,4 +34,8 @@ class SlideshowImageGallery extends TraditionalImageGallery {
        protected function getModules() {
                return [ 'mediawiki.page.gallery.slideshow' ];
        }
+
+       public function setAdditionalOptions( $params ) {
+               $this->mAttribs['data-showthumbnails'] = isset( $params['showthumbnails'] );
+       }
 }
index 094c4df..e651c9c 100644 (file)
@@ -26,7 +26,7 @@
                // Initialize
                this.drawCarousel();
                this.setSizeRequirement();
-               this.toggleThumbnails( false );
+               this.toggleThumbnails( !!this.$gallery.attr( 'data-showthumbnails' ) );
                this.showCurrentImage();
 
                // Events