From 44d45d8adb3a80e6ed8d7301e1f6cd6b3aaaea1f Mon Sep 17 00:00:00 2001 From: bordun Date: Wed, 31 Oct 2018 11:28:50 +0100 Subject: [PATCH] linkedprops: remove callbacks from this to ensure they can be recreated if needed --- src/client/app/widgets/common/widget.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/client/app/widgets/common/widget.js b/src/client/app/widgets/common/widget.js index dc49d62d..3036afa1 100644 --- a/src/client/app/widgets/common/widget.js +++ b/src/client/app/widgets/common/widget.js @@ -315,6 +315,8 @@ class Widget extends EventEmitter { widgetManager.off('widget-created', this.linkedCreatedCallback) widgetManager.off('prop-changed', this.linkedPropChangedCallback) + delete this.linkedCreatedCallback + delete this.linkedPropChangedCallback } @@ -329,6 +331,7 @@ class Widget extends EventEmitter { } else if (this.linkedPropsValueCallback && !Object.keys(this.linkedPropsValue).length) { widgetManager.off('change', this.linkedValueChangedCallback) + delete this.linkedValueChangedCallback } @@ -372,11 +375,9 @@ class Widget extends EventEmitter { updateLinkedPropsWithNesting(i) { - // 1. remove all linked props found in properties bound to the nested link - // 2. resolve these props again and recreate links (3rd arg to true) - for (var prop of this.nestedLinkedProps[i]) { + // 1. remove all linked props found in properties bound to the nested link for (var linksStores of [this.linkedPropsValue, this.linkedProps]) { for (let id in linksStores) { if (linksStores[id].includes(prop)) { @@ -387,6 +388,7 @@ class Widget extends EventEmitter { } + // 2. resolve these props again and recreate links (3rd arg to true) this.resolveProp(prop, undefined, true, this) }