From d33fb8016a6f048940adefbcb360ba99d7b7ff21 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Sat, 1 Jan 2022 13:03:20 +0100 Subject: [PATCH] Update built-in props --- src/style_manager/model/PropertyFactory.js | 9 ++++++++- test/specs/style_manager/model/PropertyFactory.js | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/style_manager/model/PropertyFactory.js b/src/style_manager/model/PropertyFactory.js index 5b42ad22e..afdfb5360 100644 --- a/src/style_manager/model/PropertyFactory.js +++ b/src/style_manager/model/PropertyFactory.js @@ -201,7 +201,7 @@ export default class PropertyFactory { ['background-color', { default: 'none' }, 'color'], // File type - ['background-image', { type: this.typeFile, functionName: 'url' }], + ['background-image', { type: this.typeFile, functionName: 'url', default: 'none' }], // Select types ['display', { type: this.typeSelect, default: 'block', options: this.opstDisplay }], @@ -341,6 +341,13 @@ export default class PropertyFactory { 'background', { detached: true, + layerLabel: (l, { values }) => { + const repeat = values['background-repeat-sub']; + const pos = values['background-position-sub']; + const att = values['background-attachment-sub']; + const size = values['background-size-sub']; + return `${repeat} ${pos} ${att} ${size}`; + }, properties: this.__sub([ { extend: 'background-image', id: 'background-image-sub' }, { extend: 'background-repeat', id: 'background-repeat-sub' }, diff --git a/test/specs/style_manager/model/PropertyFactory.js b/test/specs/style_manager/model/PropertyFactory.js index 55ae99295..a21ddae31 100644 --- a/test/specs/style_manager/model/PropertyFactory.js +++ b/test/specs/style_manager/model/PropertyFactory.js @@ -619,6 +619,7 @@ describe('PropertyFactory', () => { { property: 'background-image', id: 'background-image-sub', + default: 'none', type: 'file', functionName: 'url', },