From fdeedd6a8800319c669a0d2f32db415d1520c648 Mon Sep 17 00:00:00 2001 From: Gilles Dubuc Date: Thu, 20 Feb 2014 10:34:48 +0100 Subject: [PATCH] Fix preloadFullscreenThumnail breakage Since there was no merge conflict and the changeset worked pre-merge, when jenkins merged the fullscreen changeset, it actually turned out to be incompatible with the new code and spews out a nasty JS error. I think from now on I'll always avoid +2ing a diff that hasn't been rebased to the latest. When looking at the diff not rebased to the latest, you just can't see the issues that might happen with the latest code merged and you certainly won't spot the potential breakage that comes with it. In fact I think a lot of breakages we've encountered as of late were caused by this very issue. Change-Id: I46b7dd93c55635f34c01bd8d3eee9785140b5f35 --- resources/mmv/mmv.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/resources/mmv/mmv.js b/resources/mmv/mmv.js index 85bccc033..7871a9299 100755 --- a/resources/mmv/mmv.js +++ b/resources/mmv/mmv.js @@ -227,7 +227,7 @@ this.preloadImagesMetadata(); this.preloadThumbnails(); - this.preloadFullscreenThumbnail(); + this.preloadFullscreenThumbnail( image ); $( document.body ).addClass( 'mw-mlb-lightbox-open' ); @@ -402,13 +402,10 @@ /** * Preload the fullscreen size of the current image. */ - MMVP.preloadFullscreenThumbnail = function() { - var lightbox = this.lightbox.images[this.lightbox.currentIndex], - ui = this.lightbox.iface; - + MMVP.preloadFullscreenThumbnail = function( image ) { this.fetchThumbnail( - lightbox.filePageTitle, - ui.getLightboxImageWidthsForFullscreen( lightbox ).real + image.filePageTitle, + this.lightbox.iface.getLightboxImageWidthsForFullscreen( image ).real ); };