Add `showThumbnails` option to slideshow galleries
[lhc/web/wiklou.git] / resources / src / mediawiki / page / gallery-slideshow.js
index 26f568b..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
        /**
         * Gets the height of the interface elements and the
         * gallery's caption.
+        *
+        * @return {number} Height
         */
        mw.GallerySlideshow.prototype.getChromeHeight = function () {
                return this.$interface.outerHeight() + this.$galleryCaption.outerHeight();
                if ( this.imageInfoCache[ imageSrc ] === undefined ) {
                        api = new mw.Api();
                        // TODO: This supports only gallery of images
-                       title = new mw.Title.newFromImg( $img );
+                       title = mw.Title.newFromImg( $img );
                        params = {
                                action: 'query',
                                formatversion: 2,
        // Bootstrap all slideshow galleries
        mw.hook( 'wikipage.content' ).add( function ( $content ) {
                $content.find( '.mw-gallery-slideshow' ).each( function () {
-                       /*jshint -W031 */
+                       // eslint-disable-next-line no-new
                        new mw.GallerySlideshow( this );
-                       /*jshint +W031 */
                } );
        } );
 }( mediaWiki, jQuery, OO ) );