From 1216cea32173eb72ba9d3d433ee5a670fb088061 Mon Sep 17 00:00:00 2001 From: Benjamin Vray Date: Mon, 21 Feb 2022 14:39:33 +0100 Subject: [PATCH] [IMP] web_editor: add a new string attribute on snippet option This commit introduces a new way to set the title of an option section in the customize panel. The title can now be filled in a new "string" attribute in the template of an option. See merge commit for more information. task-2710582 --- addons/web_editor/static/src/js/editor/snippets.editor.js | 3 +++ addons/web_editor/views/snippets.xml | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/web_editor/static/src/js/editor/snippets.editor.js b/addons/web_editor/static/src/js/editor/snippets.editor.js index 189e027d82b..8949108d944 100644 --- a/addons/web_editor/static/src/js/editor/snippets.editor.js +++ b/addons/web_editor/static/src/js/editor/snippets.editor.js @@ -759,6 +759,9 @@ var SnippetEditor = Widget.extend({ if (!val.selector.is(this.$target)) { return; } + if (val.data.string) { + $optionsSection[0].querySelector('we-title > span').textContent = val.data.string; + } if (val['drop-near']) { this.selectorSiblings.push(val['drop-near']); } diff --git a/addons/web_editor/views/snippets.xml b/addons/web_editor/views/snippets.xml index 65c369df0d4..91e1c96c2a4 100644 --- a/addons/web_editor/views/snippets.xml +++ b/addons/web_editor/views/snippets.xml @@ -222,7 +222,7 @@ /> -