Browse Source

Update layers

up-style-manager
Artur Arseniev 5 years ago
parent
commit
d5d7b8cc8f
  1. 16
      src/style_manager/model/PropertyStack.js

16
src/style_manager/model/PropertyStack.js

@ -45,7 +45,6 @@ export default Property.extend({
const name = prop.getName(); const name = prop.getName();
layer.upValues({ [name]: prop.__getFullValue() }); layer.upValues({ [name]: prop.__getFullValue() });
const value = this.__getFullValue(); const value = this.__getFullValue();
console.log('__upProperties', prop.getName(), { value });
this.upValue(value, opts); this.upValue(value, opts);
}, },
@ -68,9 +67,18 @@ export default Property.extend({
_up(props, opts = {}) { _up(props, opts = {}) {
const { __layers = [], ...rest } = props; const { __layers = [], ...rest } = props;
const layers = __layers.map(values => ({ values })); const layers = this.getLayers();
this.getLayers().reset(layers); const layersNew = __layers.map(values => ({ values }));
console.log('_up from stack', this.get('property'), { layers, rest, opts, currValue: this.getFullValue() });
if (layers.length === layersNew.length) {
layersNew.map((layer, n) => {
layers.at(n)?.upValues(layer.value);
});
} else {
this.getLayers().reset(layersNew);
}
console.log('_up from stack', this.get('property'), { layersNew, rest, opts, currValue: this.getFullValue() });
return Property.prototype._up.call(this, rest, opts); return Property.prototype._up.call(this, rest, opts);
}, },

Loading…
Cancel
Save