diff --git a/resources/mmv/mmv.bootstrap.js b/resources/mmv/mmv.bootstrap.js index 870033021..18bec3d92 100644 --- a/resources/mmv/mmv.bootstrap.js +++ b/resources/mmv/mmv.bootstrap.js @@ -129,10 +129,10 @@ /** * Processes all thumbs found on the page */ - MMVB.processThumbs = function () { + MMVB.processThumbs = function ( $content ) { var bs = this; - this.$thumbs = $( + this.$thumbs = $content.find( '.gallery .image img, ' + 'a.image img, ' + '#file a img, ' + diff --git a/tests/qunit/mmv/mmv.bootstrap.test.js b/tests/qunit/mmv/mmv.bootstrap.test.js index 585ba6ab9..6d0d6270c 100644 --- a/tests/qunit/mmv/mmv.bootstrap.test.js +++ b/tests/qunit/mmv/mmv.bootstrap.test.js @@ -52,6 +52,8 @@ function createBootstrap( viewer ) { var bootstrap = new mw.mmv.MultimediaViewerBootstrap(); + bootstrap.processThumbs( $( '#qunit-fixture' ) ); + // MultimediaViewerBootstrap.ensureEventHandlersAreSetUp() is a weird workaround for gadget bugs. // MediaViewer should work without it, and so should the tests. bootstrap.ensureEventHandlersAreSetUp = $.noop;