diff --git a/modules/ve-mw/dm/models/ve.dm.MWImageModel.js b/modules/ve-mw/dm/models/ve.dm.MWImageModel.js index f31b76a79b..fe70d3e87f 100644 --- a/modules/ve-mw/dm/models/ve.dm.MWImageModel.js +++ b/modules/ve-mw/dm/models/ve.dm.MWImageModel.js @@ -1056,13 +1056,20 @@ ve.dm.MWImageModel.prototype.attachScalable = function ( scalable ) { } ); // Update media type this.setMediaType( info.mediatype ); - // Update according to type ve.dm.MWImageNode.static.syncScalableToType( this.getType(), this.getMediaType(), this.getScalable() ); + + // We have to adjust the details in the initial hash if the original + // image was 'default' since we didn't have default until now and the + // default dimensions that were 'recorded' were wrong + if ( this.initialHash.scalable.isDefault ) { + this.initialHash.scalable.currentDimensions = this.scalable.getDefaultDimensions(); + } + }, this ) ); } }; diff --git a/modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js b/modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js index fb23237b4d..2ee3c6f8c1 100644 --- a/modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js +++ b/modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js @@ -771,8 +771,11 @@ ve.ui.MWMediaDialog.prototype.attachImageModel = function () { // Size widget this.sizeErrorLabel.$element.hide(); this.sizeWidget.setScalable( this.imageModel.getScalable() ); - this.sizeWidget.connect( this, { changeSizeType: 'checkChanged' } ); - this.sizeWidget.connect( this, { change: 'checkChanged' } ); + this.sizeWidget.connect( this, { + changeSizeType: 'checkChanged', + change: 'checkChanged', + valid: 'checkChanged' + } ); // Initialize size this.sizeWidget.setSizeType(