mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-28 16:20:52 +00:00
Follow-up e2f6d798
: Make MWTemplateModel#addPromptedParameters work
Change-Id: I27e82aed207e1352ccb5f5a177fd53d5c1868c42
This commit is contained in:
parent
3a4ff4eb5f
commit
d9d6a567d8
|
@ -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++;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue