mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-29 00:30:44 +00:00
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:
parent
5f063f4e5d
commit
9f2d31cfa0
|
@ -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 );
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue