From 80d1240734c0b73fa92cb4b4c4266107b57e2914 Mon Sep 17 00:00:00 2001 From: Moriel Schottlender Date: Tue, 10 Jun 2014 15:18:36 -0400 Subject: [PATCH] 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 --- modules/ve-mw/ui/dialogs/ve.ui.MWMediaEditDialog.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/ve-mw/ui/dialogs/ve.ui.MWMediaEditDialog.js b/modules/ve-mw/ui/dialogs/ve.ui.MWMediaEditDialog.js index c3d8a8d6a0..b9b6abbaab 100644 --- a/modules/ve-mw/ui/dialogs/ve.ui.MWMediaEditDialog.js +++ b/modules/ve-mw/ui/dialogs/ve.ui.MWMediaEditDialog.js @@ -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