mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-25 06:46:26 +00:00
Actually set parameter autoValues as values
The autoValue was displayed in the UI but was never actually written into the template model, unless you changed the text input and then undid your change. Bug: 71157 Change-Id: I08e2ba88c24fdee030104c6fb9baafb558ce8a80
This commit is contained in:
parent
5a3c2a9f4c
commit
2d3bf973d2
|
@ -32,6 +32,10 @@ ve.ui.MWParameterPage = function VeUiMWParameterPage( parameter, name, config )
|
|||
this.spec = parameter.getTemplate().getSpec();
|
||||
this.defaultValue = this.spec.getParameterDefaultValue( paramName );
|
||||
this.autoValue = this.spec.getParameterAutoValue( paramName );
|
||||
if ( this.autoValue && !this.parameter.getValue() ) {
|
||||
this.parameter.setValue( this.autoValue );
|
||||
}
|
||||
|
||||
this.$info = this.$( '<div>' );
|
||||
this.$actions = this.$( '<div>' );
|
||||
this.$labelElement = this.$( '<div>' );
|
||||
|
@ -44,7 +48,7 @@ ve.ui.MWParameterPage = function VeUiMWParameterPage( parameter, name, config )
|
|||
autosize: true,
|
||||
placeholder: this.defaultValue
|
||||
} )
|
||||
.setValue( this.parameter.getValue() || this.autoValue )
|
||||
.setValue( this.parameter.getValue() )
|
||||
.connect( this, { change: 'onValueInputChange' } );
|
||||
|
||||
if ( this.parameter.isRequired() ) {
|
||||
|
|
Loading…
Reference in a new issue