Follow-up e2f6d798: Make MWTemplateModel#addPromptedParameters work

Change-Id: I27e82aed207e1352ccb5f5a177fd53d5c1868c42
This commit is contained in:
James D. Forrester 2016-06-30 16:46:38 +01:00
parent 3a4ff4eb5f
commit d9d6a567d8

View file

@ -291,18 +291,20 @@ 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 ] )
)
) {
!this.params[ name ] &&
(
spec.isParameterRequired( name ) ||
spec.isParameterSuggested( name )
)
) {
this.addParameter( new ve.dm.MWParameterModel( this, names[ i ] ) );
addedCount++;
}