mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-25 14:56:20 +00:00
Disable/Enable alignment select widget with checkbox
The test of whether to update the model should only apply to model and not GUI operations. Change-Id: I594793cbf69b41cd8fe02067e9985dd1030af95c But: 66288
This commit is contained in:
parent
9f2d31cfa0
commit
80d1240734
|
@ -368,12 +368,13 @@ ve.ui.MWMediaEditDialog.prototype.onPositionCheckboxChange = function ( checked
|
|||
var newPositionValue,
|
||||
currentModelAlignment = this.imageModel.getAlignment();
|
||||
|
||||
// Only update if the current value is different than that of the image model
|
||||
this.positionInput.setDisabled( !checked );
|
||||
// Only update the model if the current value is different than that
|
||||
// of the image model
|
||||
if (
|
||||
( currentModelAlignment === 'none' && checked ) ||
|
||||
( currentModelAlignment !== 'none' && !checked )
|
||||
) {
|
||||
this.positionInput.setDisabled( !checked );
|
||||
if ( checked ) {
|
||||
// Picking a floating alignment value will create a block image
|
||||
// no matter what the type is, so in here we want to calculate
|
||||
|
|
Loading…
Reference in a new issue