mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-25 14:56:20 +00:00
Merge "Don't show edit summary preview if it's blank"
This commit is contained in:
commit
0d3e4ea355
|
@ -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 */
|
||||
|
|
Loading…
Reference in a new issue