mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-25 06:46:26 +00:00
Don't show edit summary preview if it's blank
Bug: 61716 Change-Id: I6cd7ee0ad947dcac24a50b6df61316fde74edb43
This commit is contained in:
parent
4ab10a377e
commit
1e8be87f43
|
@ -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