From d8040dbffcbdfffceb20f93e582cc4b80f5a3266 Mon Sep 17 00:00:00 2001 From: Moriel Schottlender Date: Wed, 21 May 2014 14:41:33 -0400 Subject: [PATCH] Don't update image model twice The image model is updated through events from the edit dialog. There is no need to update the states of the select/checkboxes at the end in 'apply'. The only inputs that are not updated on change are caption and alternate text. Bug: 65564 Change-Id: I18c009546120e270467418cff677ec491fd109ca --- modules/ve-mw/ui/dialogs/ve.ui.MWMediaEditDialog.js | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/modules/ve-mw/ui/dialogs/ve.ui.MWMediaEditDialog.js b/modules/ve-mw/ui/dialogs/ve.ui.MWMediaEditDialog.js index 1a1011026f..9c936380f0 100644 --- a/modules/ve-mw/ui/dialogs/ve.ui.MWMediaEditDialog.js +++ b/modules/ve-mw/ui/dialogs/ve.ui.MWMediaEditDialog.js @@ -526,22 +526,11 @@ ve.ui.MWMediaEditDialog.prototype.applyChanges = function () { this.imageModel.setAltText( this.altTextInput.getValue() ); + this.imageModel.setCaptionDocument( this.captionSurface.getSurface().getModel().getDocument() ); - if ( this.typeInput.getSelectedItem() ) { - this.imageModel.setType( - this.typeInput.getSelectedItem().getData() - ); - } - if ( this.positionCheckbox.getValue() && this.positionInput.getSelectedItem() ) { - this.imageModel.setAlignment( - this.positionInput.getSelectedItem().getData() - ); - } - this.imageModel.toggleBorder( this.borderCheckbox.getValue() ); - // Check if the image node changed from inline to block or // vise versa if ( this.mediaNode.type !== this.imageModel.getImageNodeType() ) {