Browse Source

Add `prepend` option to the stack style manager type

pull/2675/head
Artur Arseniev 6 years ago
parent
commit
9b46fe3b22
  1. 3
      src/style_manager/model/PropertyStack.js
  2. 9
      src/style_manager/view/PropertyStackView.js

3
src/style_manager/model/PropertyStack.js

@ -10,6 +10,9 @@ export default Property.extend({
// The separator used to join layer values
layerSeparator: ', ',
// Prepend new layers in the list
prepend: 0,
// Layer preview
preview: 0
},

9
src/style_manager/view/PropertyStackView.js

@ -68,9 +68,16 @@ export default PropertyCompositeView.extend({
addLayer() {
const model = this.model;
const layers = this.getLayers();
const prepend = model.get('prepend');
const properties = model.get('properties').deepClone();
properties.each(property => property.set('value', ''));
const layer = layers.add({ properties }, { active: 1 });
const layer = layers.add(
{ properties },
{
active: 1,
...(prepend && { at: 0 })
}
);
// In detached mode inputValueChanged will add new 'layer value'
// to all subprops

Loading…
Cancel
Save