mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/MultimediaViewer
synced 2024-11-24 08:13:38 +00:00
Fix bug when exiting Media Viewer while image is loading
Which would cause the image to never appear, even when reopening Media Viewer. The source of the issue was an uncaught exception in ThumbnailWidth. Unfortunately this cannot be covered by E2E because the image loads too fast in that context, and cucumber/selenium doesn't have time to catch the placeholder. Change-Id: I9386f6e857a7974166ddb5eeb7ea731d943eddcf Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/450
This commit is contained in:
parent
9b1e756c3b
commit
9d51e534da
|
@ -499,6 +499,12 @@
|
|||
|
||||
this.thumbnailPreloadQueue = this.pushLightboxImagesIntoQueue( function( lightboxImage ) {
|
||||
return function() {
|
||||
// viewer.ui.canvas.getLightboxImageWidths needs the viewer to be open
|
||||
// because it needs to read the size of visible elements
|
||||
if ( !viewer.isOpen ) {
|
||||
return;
|
||||
}
|
||||
|
||||
return viewer.fetchThumbnailForLightboxImage(
|
||||
lightboxImage,
|
||||
viewer.ui.canvas.getLightboxImageWidths( lightboxImage ).real
|
||||
|
|
Loading…
Reference in a new issue