Initialize the save dialog correctly even if the sanity check failed

A very weird if statement caused pretty much all logic for displaying
the 'save' panel to be skipped if the sanity check had failed. The
result was that all buttons were displayed at the bottom of the
save dialog, even those that don't make sense in that context.

Change-Id: I628ebc05830fb25d67ff181852a1e56f0e25dee9
This commit is contained in:
Roan Kattouw 2013-10-17 15:29:03 +02:00
parent 7ffc900a7f
commit f81de3e1e9

View file

@ -211,21 +211,20 @@ ve.ui.MWSaveDialog.prototype.swapPanel = function ( panel ) {
case 'save':
if ( !this.sanityCheckVerified ) {
this.showMessage( 'dirtywarning', mw.msg( 'visualeditor-savedialog-warning-dirty' ) );
} else {
this.saveButton.$.show();
this.reviewButton.$.show();
this.reviewGoodButton.$.hide();
this.resolveConflictButton.$.hide();
setTimeout( function () {
// fix input reference
var $textarea = dialog.editSummaryInput.$input;
$textarea.focus();
// If message has be pre-filled (e.g. section edit), move cursor to end
if ( $textarea.val() !== '' ) {
ve.selectEnd( $textarea[0] );
}
} );
}
this.saveButton.$.show();
this.reviewButton.$.show();
this.reviewGoodButton.$.hide();
this.resolveConflictButton.$.hide();
setTimeout( function () {
// fix input reference
var $textarea = dialog.editSummaryInput.$input;
$textarea.focus();
// If message has be pre-filled (e.g. section edit), move cursor to end
if ( $textarea.val() !== '' ) {
ve.selectEnd( $textarea[0] );
}
} );
break;
case 'conflict':
this.saveButton.$.hide();