mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 02:23:58 +00:00
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:
parent
e6fe32902d
commit
7047830bf3
|
@ -112,8 +112,8 @@ ve.ui.MWMediaResultWidget.prototype.calculateSizing = function ( originalDimensi
|
||||||
imageDimensions = ve.dm.MWImageNode.static.resizeToBoundingBox(
|
imageDimensions = ve.dm.MWImageNode.static.resizeToBoundingBox(
|
||||||
// Image original dimensions
|
// Image original dimensions
|
||||||
{
|
{
|
||||||
width: originalDimensions.width,
|
width: originalDimensions.width || originalDimensions.thumbwidth,
|
||||||
height: originalDimensions.height
|
height: originalDimensions.height || originalDimensions.thumbwidth
|
||||||
},
|
},
|
||||||
// Bounding box
|
// Bounding box
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue