From 55298d001aa7542eea17bb6865ae84499697b489 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Thu, 4 Jan 2018 09:15:34 +0100 Subject: [PATCH] property inheritance: watch for widgetid creation event even if none found initially in case it gets created after --- .../js/app/widgets/common/_widgets_base.js | 37 ++++++++++--------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/src/browser/js/app/widgets/common/_widgets_base.js b/src/browser/js/app/widgets/common/_widgets_base.js index 7e25816c..17648fce 100644 --- a/src/browser/js/app/widgets/common/_widgets_base.js +++ b/src/browser/js/app/widgets/common/_widgets_base.js @@ -175,30 +175,31 @@ module.exports = class _widgets_base { } } + if (id != 'this' && id != 'parent' && storeLinks) { + + if (k == '_value') { + + if (!this.linkedPropsValue[id]) this.linkedPropsValue[id] = [] + this.linkedPropsValue[id].push(propName) + + } else { + + + if (!this.linkedProps[id]) this.linkedProps[id] = [] + this.linkedProps[id].push(propName) + + } + + } + for (var i in widgets) { + if (widgets[i].props.hasOwnProperty(k) || k == '_value') { if (originalPropName == k && widgets[i].props.id == originalWidget.props.id) { throw `Circular property reference for ${originalWidget.props.id}.${originalPropName}` } - if (id != 'this' && id != 'parent' && storeLinks) { - - if (k == '_value') { - - if (!this.linkedPropsValue[id]) this.linkedPropsValue[id] = [] - this.linkedPropsValue[id].push(propName) - - } else { - - - if (!this.linkedProps[id]) this.linkedProps[id] = [] - this.linkedProps[id].push(propName) - - } - - } - var r = k == '_value' ? widgets[i].getValue(true) : widgets[i].resolveProp(k, undefined, storeLinks, originalWidget, originalPropName) @@ -209,7 +210,9 @@ module.exports = class _widgets_base { return r } + } + }) try {