mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-12-01 09:26:37 +00:00
Follow-up e2f6d798
: Make MWTemplateModel#addPromptedParameters work
Change-Id: I27e82aed207e1352ccb5f5a177fd53d5c1868c42
This commit is contained in:
parent
3a4ff4eb5f
commit
d9d6a567d8
|
@ -291,16 +291,18 @@ ve.dm.MWTemplateModel.prototype.removeParameter = function ( param ) {
|
|||
* @inheritdoc
|
||||
*/
|
||||
ve.dm.MWTemplateModel.prototype.addPromptedParameters = function () {
|
||||
var i, len, addedCount = 0,
|
||||
var i, len, name,
|
||||
addedCount = 0,
|
||||
spec = this.getSpec(),
|
||||
names = spec.getParameterNames();
|
||||
|
||||
for ( i = 0, len = names.length; i < len; i++ ) {
|
||||
name = names[ i ];
|
||||
if (
|
||||
!this.params[ name ] &&
|
||||
(
|
||||
spec.isParameterRequired( names[ i ] ) ||
|
||||
spec.isParameterSuggested( names[ i ] )
|
||||
spec.isParameterRequired( name ) ||
|
||||
spec.isParameterSuggested( name )
|
||||
)
|
||||
) {
|
||||
this.addParameter( new ve.dm.MWParameterModel( this, names[ i ] ) );
|
||||
|
|
Loading…
Reference in a new issue