Browse Source

Update symbols for remove and reset

symbols-2
Artur Arseniev 5 years ago
parent
commit
4e98fc5483
  1. 23
      src/dom_components/model/Component.js

23
src/dom_components/model/Component.js

@ -606,17 +606,16 @@ const Component = Backbone.Model.extend(Styleable).extend(
}, },
__getSymbToUp(opts = {}) { __getSymbToUp(opts = {}) {
const symbol = this.get(keySymbols); const { fromInstance } = opts;
const symbolOf = this.__getSymbol(); const symbols = this.get(keySymbols) || [];
let result = !this.__isSymbol() const symbol = this.__getSymbol();
? [] let result =
: symbol.filter(md => md.collection || md.prevColl); symbol && !fromInstance
? [symbol]
if (opts.useMain && symbolOf) { : symbols.filter(md => md.collection || md.prevColl);
result = [symbolOf];
} if (fromInstance) {
if (opts.fromInstance) { result = result.filter(i => i !== fromInstance);
result = result.filter(i => i !== opts.fromInstance);
} }
return result; return result;
@ -660,7 +659,7 @@ const Component = Backbone.Model.extend(Styleable).extend(
__upSymbComps(m, c, o) { __upSymbComps(m, c, o) {
const { fromInstance } = o || c || {}; const { fromInstance } = o || c || {};
const useMain = this.get(keySymbol2w) && !fromInstance; const useMain = !fromInstance;
const toUpOpts = { useMain, fromInstance }; const toUpOpts = { useMain, fromInstance };
if (!o) { if (!o) {

Loading…
Cancel
Save