advanced syntaxes: VAR{} not updating when the default value is edited

This commit is contained in:
jean-emmanuel 2021-05-06 14:27:31 +02:00
parent 16442b664f
commit 60621203e5
3 changed files with 19 additions and 1 deletions

View file

@ -649,6 +649,16 @@ class Widget extends EventEmitter {
}
// update value if default changed
if (
value !== undefined &&
!this.variables[name].updated && // only true on edit
value !== this.variables[name].default
) {
this.variables[name].default = value
this.variables[name].value = value
}
var r = this.variables[name].value
var varname = 'VAR_' + varnumber

View file

@ -111,7 +111,9 @@ class ScriptVm extends Vm {
if (widgets[i].variables[name]) {
widgets[i].variables[name].value = value
widgets[i].variables[name].updated = 1
widgets[i].updateProps(widgets[i].variables[name].propNames)
widgets[i].variables[name].updated = 0
} else {