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

This commit is contained in:
jenkins-bot 2014-02-22 15:39:49 +00:00 committed by Gerrit Code Review
commit 0d3e4ea355

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 */