Merge "Fix bug when exiting Media Viewer while image is loading"

This commit is contained in:
jenkins-bot 2014-04-16 20:39:23 +00:00 committed by Gerrit Code Review
commit fff6c55695

View file

@ -499,6 +499,12 @@
this.thumbnailPreloadQueue = this.pushLightboxImagesIntoQueue( function( lightboxImage ) { this.thumbnailPreloadQueue = this.pushLightboxImagesIntoQueue( function( lightboxImage ) {
return function() { 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( return viewer.fetchThumbnailForLightboxImage(
lightboxImage, lightboxImage,
viewer.ui.canvas.getLightboxImageWidths( lightboxImage ).real viewer.ui.canvas.getLightboxImageWidths( lightboxImage ).real