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:
Roan Kattouw 2014-10-22 15:46:20 -07:00
parent 5a3c2a9f4c
commit 2d3bf973d2

View file

@ -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() ) {