formula: fix multiline expression parsing

This commit is contained in:
jean-emmanuel 2017-12-31 12:40:37 +01:00
parent 3de696f97f
commit 179f48e1e1

View file

@ -142,6 +142,8 @@ module.exports = class Formula extends _widgets_base {
var s = this.condition.eval(variables).valueOf()
if (Array.isArray(s) && s.length == 1) s = s[0]
this.conditionState = s.data !== undefined ? s.data : s
} catch(err) {
@ -156,6 +158,8 @@ module.exports = class Formula extends _widgets_base {
var v = this.formula.eval(variables).valueOf()
if (Array.isArray(v) && v.length == 1) v = v[0]
this.value = v.data ? v.data : v
this.showValue()