MWMediaResultWidget: Fallback for 'images' without dimensions

When the MWMediaResultWidget receives a file that has no graphical
represenation (width:0 height:0) it uses minWidth of 30px for width of the
thumbnail.

This is, for example, the case with PDF files if the PdfHandler extension is
not active.

This patch solves the issue by falling back to the thumbwidth/thumbheight
values if width/height are 0.

Change-Id: I6bdaf1aafc0c45e26d31cd9dd9504e193f04e717
This commit is contained in:
Robert Vogel 2015-08-12 16:01:49 +02:00 committed by Alex Monk
parent e6fe32902d
commit 7047830bf3

View file

@ -112,8 +112,8 @@ ve.ui.MWMediaResultWidget.prototype.calculateSizing = function ( originalDimensi
imageDimensions = ve.dm.MWImageNode.static.resizeToBoundingBox(
// Image original dimensions
{
width: originalDimensions.width,
height: originalDimensions.height
width: originalDimensions.width || originalDimensions.thumbwidth,
height: originalDimensions.height || originalDimensions.thumbwidth
},
// Bounding box
{