Don't show edit summary preview if it's blank

Bug: 61716
Change-Id: I6cd7ee0ad947dcac24a50b6df61316fde74edb43
This commit is contained in:
Alex Monk 2014-02-21 12:59:37 +00:00 committed by Krenair
parent 4ab10a377e
commit 1e8be87f43

View file

@ -154,13 +154,20 @@ ve.ui.MWSaveDialog.prototype.swapPanel = function ( panel ) {
}
this.lastEditSummaryWikitext = currentEditSummaryWikitext;
this.$reviewEditSummary.empty()
.parent().addClass( 'mw-ajax-loader' );
.parent().show().addClass( 'mw-ajax-loader' );
this.editSummaryXhr = new mw.Api().post( {
action: 'parse',
summary: currentEditSummaryWikitext
} ).done( function ( result ) {
dialog.$reviewEditSummary.html( ve.msg( 'parentheses', result.parse.parsedsummary['*'] ) )
.parent().removeClass( 'mw-ajax-loader' );
if ( result.parse.parsedsummary['*'] === '' ) {
dialog.$reviewEditSummary.parent().hide();
} else {
dialog.$reviewEditSummary.html( ve.msg( 'parentheses', result.parse.parsedsummary['*'] ) );
}
} ).fail( function () {
dialog.$reviewEditSummary.parent().hide();
} ).always( function () {
dialog.$reviewEditSummary.parent().removeClass( 'mw-ajax-loader' );
} );
}
/* falls through */