mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-28 16:20:52 +00:00
Check whether template is altered before allowing apply
Again. Originally done in I5a664f86, the crucial part of which was reversed in I1500f480. Bug: T89913 Change-Id: I39b0cdcdb5f76fa75f506c874ef6223d8d8d53e6
This commit is contained in:
parent
1960cc7406
commit
85373bcb9a
|
@ -254,7 +254,7 @@ ve.ui.MWTemplateDialog.prototype.setApplicableStatus = function () {
|
|||
var parts = this.transclusionModel && this.transclusionModel.getParts();
|
||||
|
||||
if ( parts.length && !( parts[0] instanceof ve.dm.MWTemplatePlaceholderModel ) ) {
|
||||
this.actions.setAbilities( { apply: true, insert: true } );
|
||||
this.actions.setAbilities( { apply: this.altered, insert: true } );
|
||||
} else {
|
||||
// Loading is resolved. We have either: 1) no parts, or 2) the a placeholder as the first part
|
||||
this.actions.setAbilities( { apply: parts.length === 0 && this.altered, insert: false } );
|
||||
|
|
Loading…
Reference in a new issue