From 4e98fc54832fb4b72a730116428a2fc66773936c Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Sun, 17 Jan 2021 01:29:52 +0100 Subject: [PATCH] Update symbols for remove and reset --- src/dom_components/model/Component.js | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/dom_components/model/Component.js b/src/dom_components/model/Component.js index 7204a8280..f22ff6d4d 100644 --- a/src/dom_components/model/Component.js +++ b/src/dom_components/model/Component.js @@ -606,17 +606,16 @@ const Component = Backbone.Model.extend(Styleable).extend( }, __getSymbToUp(opts = {}) { - const symbol = this.get(keySymbols); - const symbolOf = this.__getSymbol(); - let result = !this.__isSymbol() - ? [] - : symbol.filter(md => md.collection || md.prevColl); - - if (opts.useMain && symbolOf) { - result = [symbolOf]; - } - if (opts.fromInstance) { - result = result.filter(i => i !== opts.fromInstance); + const { fromInstance } = opts; + const symbols = this.get(keySymbols) || []; + const symbol = this.__getSymbol(); + let result = + symbol && !fromInstance + ? [symbol] + : symbols.filter(md => md.collection || md.prevColl); + + if (fromInstance) { + result = result.filter(i => i !== fromInstance); } return result; @@ -660,7 +659,7 @@ const Component = Backbone.Model.extend(Styleable).extend( __upSymbComps(m, c, o) { const { fromInstance } = o || c || {}; - const useMain = this.get(keySymbol2w) && !fromInstance; + const useMain = !fromInstance; const toUpOpts = { useMain, fromInstance }; if (!o) {