Merge "Initialize gallery slideshow on wikipage.content hook"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Tue, 15 Nov 2016 09:44:31 +0000 (09:44 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 15 Nov 2016 09:44:31 +0000 (09:44 +0000)
resources/src/mediawiki/page/gallery-slideshow.js

index cf448b0..26f568b 100644 (file)
        };
 
        // Bootstrap all slideshow galleries
-       $( function () {
-               $( '.mw-gallery-slideshow' ).each( function () {
+       mw.hook( 'wikipage.content' ).add( function ( $content ) {
+               $content.find( '.mw-gallery-slideshow' ).each( function () {
                        /*jshint -W031 */
                        new mw.GallerySlideshow( this );
                        /*jshint +W031 */