Default/custom switch size quickfix

Handling a bug where the placeholders weren't set to images that weren't
set to default size. The switch to 'default' failed because there were
no placeholders and data for default to go on. This is now fixed in this
commit; if the image is non-default, the values are given to the media
size widget from the config settings.

Change-Id: I402b8d4de606c0939daa316408fcf5de2f0b2181
This commit is contained in:
Moriel Schottlender 2014-02-26 18:26:30 -05:00
parent 0d5021bf33
commit 0f51538272

View file

@ -523,6 +523,17 @@ ve.ui.MWMediaEditDialog.prototype.setup = function ( data ) {
'height': 0
} );
} else {
// Set placeholders for the default bounding box
if ( this.mediaNode.getAttribute( 'width' ) > this.mediaNode.getAttribute( 'height' ) ) {
this.sizeWidget.setPlaceholderDimensions( {
'width': this.defaultThumbSize,
} );
} else {
this.sizeWidget.setPlaceholderDimensions( {
'height': this.defaultThumbSize
} );
}
this.sizeSelectWidget.intializeSelection(
this.sizeSelectWidget.getItemFromData( 'custom' )
);