From b99099fc5c76d635da1eb01ac0968d5487e44bb2 Mon Sep 17 00:00:00 2001 From: Derk-Jan Hartman Date: Mon, 14 Nov 2016 22:46:10 +0100 Subject: [PATCH] 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 --- resources/src/mediawiki/page/gallery-slideshow.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 */ -- 2.20.1