From ae5ee833b1c96130bccc6e33fb328feb0d4f622f Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Fri, 14 May 2021 10:22:27 +0200 Subject: [PATCH] widgets: reduce scope of commit 073bf9e857d5fd3a6bab95987ee8787f42f06356 --- src/client/widgets/common/widget.js | 9 ++++----- src/client/widgets/containers/matrix.js | 6 ++++++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/client/widgets/common/widget.js b/src/client/widgets/common/widget.js index 0ffbd91c..37892089 100644 --- a/src/client/widgets/common/widget.js +++ b/src/client/widgets/common/widget.js @@ -509,11 +509,6 @@ class Widget extends EventEmitter { jsScope = context || {}, varnumber = 999 - - if (typeof propValue === 'object' && propValue !== null) { - propValue = JSON.stringify(propValue) - } - if (typeof propValue == 'string') { propValue = balancedReplace('@', '{', '}', propValue, (content)=>{ @@ -777,6 +772,10 @@ class Widget extends EventEmitter { } catch (err) {} } + } else if (propValue != null && typeof propValue == 'object') { + for (let k in propValue) { + propValue[k] = this.resolveProp(propName, propValue[k], storeLinks, originalWidget, originalPropName, context) + } } return propValue diff --git a/src/client/widgets/containers/matrix.js b/src/client/widgets/containers/matrix.js index 169285ae..4b6fc4f2 100644 --- a/src/client/widgets/containers/matrix.js +++ b/src/client/widgets/containers/matrix.js @@ -170,6 +170,12 @@ class Matrix extends Panel { if (propName === 'props') { + propValue = propValue !== undefined ? propValue : deepCopy(this.props[propName]) + + if (typeof propValue === 'object' && propValue !== null) { + propValue = JSON.stringify(propValue) + } + var data = [] for (var i = 0; i < this.getProp('quantity'); i++) { data[i] = super.resolveProp(propName, propValue, storeLinks, originalWidget, originalPropName, {$: i})