Merge "Update initialHash after getting defaultDimensions in image model"

This commit is contained in:
jenkins-bot 2014-10-23 20:00:20 +00:00 committed by Gerrit Code Review
commit 7c8931f655
2 changed files with 13 additions and 3 deletions

View file

@ -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 ) );
}
};

View file

@ -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(