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:
Moriel Schottlender 2014-06-10 15:18:36 -04:00
parent 9f2d31cfa0
commit 80d1240734

View file

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