From 044a3cfdb3c02aa3cdf15b37f51810f5ae51ab74 Mon Sep 17 00:00:00 2001 From: can-odoo Date: Tue, 11 Oct 2022 05:43:02 +0000 Subject: [PATCH] [IMP] web_editor: set default values for repeat-pattern background size Description of the issue/feature this PR addresses: --- When a user chooses "Repeat Pattern" as the background image position, nothing happens. Current behavior before PR: --- As the background size is set to auto, for background-position `repeat-pattern` no effect[1] can be seen in the background size. [1]: https://bit.ly/3MM31Ac Desired behavior after PR is merged: --- Not a bug but can be considered an improvement in features by setting some default[2] width or height for a repeat-pattern option for all relevant snippets. [2]: https://bit.ly/3GbGIBo task- 2862510 closes odoo/odoo#102995 Signed-off-by: Romain Derie (rde) --- addons/web_editor/static/src/js/editor/snippets.options.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web_editor/static/src/js/editor/snippets.options.js b/addons/web_editor/static/src/js/editor/snippets.options.js index 1825fe411e5..60d89f17618 100644 --- a/addons/web_editor/static/src/js/editor/snippets.options.js +++ b/addons/web_editor/static/src/js/editor/snippets.options.js @@ -7314,7 +7314,7 @@ registry.BackgroundPosition = SnippetOptionWidget.extend({ backgroundType: function (previewMode, widgetValue, params) { this.$target.toggleClass('o_bg_img_opt_repeat', widgetValue === 'repeat-pattern'); this.$target.css('background-position', ''); - this.$target.css('background-size', ''); + this.$target.css('background-size', widgetValue !== 'repeat-pattern' ? '' : '100px'); }, /** * Saves current background position and enables overlay.