Disable the size widget for 'frame' images

Frame images are not resizable; disable the media size widget when
the frame type is selected.

Depends on the change in ve-core:
Id1010798d30e2928358acb5694c429b9ab68ad57

Bug: 66353
Change-Id: I8c8da8933c51ba709a834731425d19445009673f
This commit is contained in:
Moriel Schottlender 2014-06-09 14:47:22 -04:00 committed by Jforrester
parent 5f063f4e5d
commit 9f2d31cfa0
2 changed files with 10 additions and 0 deletions

View file

@ -621,6 +621,11 @@ ve.dm.MWImageModel.prototype.setType = function ( type ) {
this.toggleBorderable( true );
}
// If type is frame, set to 'default' size
if ( type === 'frame' ) {
this.toggleDefaultSize( true );
}
// Let the image node update scalable considerations
// for default and max dimensions as per the new type.
this.getMediaNode().syncScalableToType( type );

View file

@ -428,6 +428,9 @@ ve.ui.MWMediaEditDialog.prototype.onTypeInputChoose = function ( item ) {
if ( this.imageModel.getType() !== type ) {
this.imageModel.setType( type );
}
// If type is 'frame', disable the size input widget completely
this.sizeWidget.setDisabled( type === 'frame' );
};
/**
@ -472,6 +475,8 @@ ve.ui.MWMediaEditDialog.prototype.getSetupProcess = function ( data ) {
'custom'
);
this.sizeWidget.setDisabled( this.imageModel.getType() === 'frame' );
// Set initial alt text
this.altTextInput.setValue(
this.imageModel.getAltText()