From 2d3bf973d258e926fa6f71e28f0de8b9fe754b90 Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Wed, 22 Oct 2014 15:46:20 -0700 Subject: [PATCH] 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 --- modules/ve-mw/ui/pages/ve.ui.MWParameterPage.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/ve-mw/ui/pages/ve.ui.MWParameterPage.js b/modules/ve-mw/ui/pages/ve.ui.MWParameterPage.js index 3c70dfcc0a..8aa5ae6df8 100644 --- a/modules/ve-mw/ui/pages/ve.ui.MWParameterPage.js +++ b/modules/ve-mw/ui/pages/ve.ui.MWParameterPage.js @@ -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.$( '
' ); this.$actions = this.$( '
' ); this.$labelElement = this.$( '
' ); @@ -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() ) {