diff --git a/addons/web_editor/static/src/scss/wysiwyg_snippets.scss b/addons/web_editor/static/src/scss/wysiwyg_snippets.scss index 4bd1546c478..44a56663f40 100644 --- a/addons/web_editor/static/src/scss/wysiwyg_snippets.scss +++ b/addons/web_editor/static/src/scss/wysiwyg_snippets.scss @@ -1118,3 +1118,8 @@ body.editor_enable.editor_has_snippets { opacity: 0; animation: fadeInDownSmall 700ms forwards; } + +// CONTAINER PREVIEW +.o_container_preview { + outline: 2px dashed $o-we-handles-accent-color; +} diff --git a/addons/website/static/src/js/editor/snippets.options.js b/addons/website/static/src/js/editor/snippets.options.js index 96ba1d63bb0..d752b0710e7 100644 --- a/addons/website/static/src/js/editor/snippets.options.js +++ b/addons/website/static/src/js/editor/snippets.options.js @@ -1831,6 +1831,31 @@ options.registry.CoverProperties = options.Class.extend({ }, }); +options.registry.ContainerWidth = options.Class.extend({ + /** + * @override + */ + cleanForSave: function () { + this.$target.removeClass('o_container_preview'); + }, + + //-------------------------------------------------------------------------- + // Options + //-------------------------------------------------------------------------- + + /** + * @override + */ + selectClass: async function (previewMode, widgetValue, params) { + await this._super(...arguments); + if (previewMode === 'reset') { + this.$target.removeClass('o_container_preview'); + } else if (previewMode) { + this.$target.addClass('o_container_preview'); + } + }, +}); + /** * Allows snippets to be moved before the preceding element or after the following. */ diff --git a/addons/website/views/snippets/snippets.xml b/addons/website/views/snippets/snippets.xml index b65c73fe185..e4c6c46323e 100644 --- a/addons/website/views/snippets/snippets.xml +++ b/addons/website/views/snippets/snippets.xml @@ -466,7 +466,7 @@ -
Full