From: pppery Date: Sat, 17 Dec 2016 02:11:12 +0000 (-0500) Subject: Add `showThumbnails` option to slideshow galleries X-Git-Tag: 1.31.0-rc.0~4430^2 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=7fd737c4aa8fe8838e17ea7790471ebbc7c41b9e;p=lhc%2Fweb%2Fwiklou.git Add `showThumbnails` option to slideshow galleries 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 --- diff --git a/includes/gallery/SlideshowImageGallery.php b/includes/gallery/SlideshowImageGallery.php index 3f0c9329d0..f29c565fc9 100644 --- a/includes/gallery/SlideshowImageGallery.php +++ b/includes/gallery/SlideshowImageGallery.php @@ -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'] ); + } } diff --git a/resources/src/mediawiki/page/gallery-slideshow.js b/resources/src/mediawiki/page/gallery-slideshow.js index 094c4df360..e651c9cc96 100644 --- a/resources/src/mediawiki/page/gallery-slideshow.js +++ b/resources/src/mediawiki/page/gallery-slideshow.js @@ -26,7 +26,7 @@ // Initialize this.drawCarousel(); this.setSizeRequirement(); - this.toggleThumbnails( false ); + this.toggleThumbnails( !!this.$gallery.attr( 'data-showthumbnails' ) ); this.showCurrentImage(); // Events