mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Cite
synced 2024-11-27 16:30:12 +00:00
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:
parent
6d512c7667
commit
8902cea828
|
@ -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() } );
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue