Browse Source

Create symbols on clone

pull/3165/head
Artur Arseniev 5 years ago
parent
commit
222379e166
  1. 9
      src/dom_components/model/Component.js

9
src/dom_components/model/Component.js

@ -585,6 +585,11 @@ const Component = Backbone.Model.extend(Styleable).extend(
return isArray(this.get('__symbol'));
},
__isSymbolTop() {
const parent = this.parent();
return this.__isSymbol() && parent && !parent.__isSymbol();
},
__getSymbolOf() {
return this.get('__symbolOf');
},
@ -972,6 +977,10 @@ const Component = Backbone.Model.extend(Styleable).extend(
attr.classes = [];
attr.traits = [];
if (this.__isSymbolTop()) {
opt.symbol = 1;
}
this.get('components').each((md, i) => {
attr.components[i] = md.clone({ ...opt, _inner: 1 });
});

Loading…
Cancel
Save