Use .containsValuableData() method from transclusion model

This is even more reliable because it also considers auto-values,
for example.

Depends-On: I522b888e366f066b28983a18041a8728d11623df
Change-Id: If83b9da65be9a759a82e8512ae171f802da9f597
This commit is contained in:
Thiemo Kreuz 2021-09-27 11:17:38 +02:00
parent 6d512c7667
commit 8902cea828

View file

@ -135,27 +135,7 @@ ve.ui.MWCitationDialog.prototype.setApplicableStatus = function () {
// Parent method disables 'done' if no changes were made (this is okay for us), and
// disables 'insert' if transclusion is empty (but it is never empty in our case).
// Instead, disable 'insert' if no parameters were added.
this.actions.setAbilities( { insert: this.hasUsefulParameter() } );
};
/**
* Works out whether there are any set parameters that aren't just placeholders
*
* @return {boolean}
*/
ve.ui.MWCitationDialog.prototype.hasUsefulParameter = function () {
var name, page;
for ( name in this.bookletLayout.pages ) {
page = this.bookletLayout.pages[ name ];
if (
page instanceof ve.ui.MWParameterPage &&
page.valueInput.getValue() !== ''
) {
return true;
}
}
return false;
this.actions.setAbilities( { insert: this.transclusionModel.containsValuableData() } );
};
/**