From: Derk-Jan Hartman Date: Mon, 14 Nov 2016 21:46:10 +0000 (+0100) Subject: Initialize gallery slideshow on wikipage.content hook X-Git-Tag: 1.31.0-rc.0~4867^2 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/modifier.php?a=commitdiff_plain;ds=sidebyside;h=b99099fc5c76d635da1eb01ac0968d5487e44bb2;p=lhc%2Fweb%2Fwiklou.git Initialize gallery slideshow on wikipage.content hook The slideshow mode of gallery tag was triggered upon document.ready, instead of on wikipage.content. For this reason, after editing and saving one of these galleries in VE, you would loose your slideshow mode and default back to packed mode. Change-Id: I411703b3c1cafbd7d763cbaa8bc9585924c51030 --- diff --git a/resources/src/mediawiki/page/gallery-slideshow.js b/resources/src/mediawiki/page/gallery-slideshow.js index cf448b0183..26f568b2cf 100644 --- a/resources/src/mediawiki/page/gallery-slideshow.js +++ b/resources/src/mediawiki/page/gallery-slideshow.js @@ -450,8 +450,8 @@ }; // 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 */