Limit image search to content firing event

Bug: T140574
Change-Id: I3c504c09b2b382e094ab2be1fa388efa7ec827b1
This commit is contained in:
Ed Sanders 2016-07-18 11:00:46 +01:00
parent c22a5eeadd
commit db6c74a232
2 changed files with 4 additions and 2 deletions

View file

@ -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, ' +

View file

@ -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;