MWSaveDialog: Switch to save panel when showing message

Fixing T107251 made it so that clicking "save" always switched back to the
save panel momentarily, causing a flicker of "maybe I can edit this"
experience. With this change, we can only switch back to the save panel when
saving from other panels if a message is being shown.

Bug: T156891
Change-Id: I8f67693283e61c39cfce40ee12d5c6788dd97932
This commit is contained in:
David Lynch 2017-02-16 10:32:21 -06:00
parent 7d95edacde
commit 288422cb9e

View file

@ -317,6 +317,8 @@ ve.ui.MWSaveDialog.prototype.showMessage = function ( name, message, options ) {
progress: this.updateSize.bind( this )
} );
this.swapPanel( 'save' );
this.messages[ name ] = $message;
}
};
@ -626,7 +628,6 @@ ve.ui.MWSaveDialog.prototype.getActionProcess = function ( action ) {
return new OO.ui.Process( function () {
var saveDeferred = $.Deferred();
this.clearMessage( 'keyboard-shortcut-submit' );
this.swapPanel( 'save' );
this.emit( 'save', saveDeferred );
return saveDeferred.promise();
}, this );