mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-09-25 11:16:51 +00:00
Merge "Update initialHash after getting defaultDimensions in image model"
This commit is contained in:
commit
7c8931f655
|
@ -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 ) );
|
||||
}
|
||||
};
|
||||
|
|
|
@ -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(
|
||||
|
|
Loading…
Reference in a new issue