[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) <rde@odoo.com>
This commit is contained in:
can-odoo
2023-05-02 20:01:39 +02:00
committed by Chintan Panchal (can)
parent 91f4b4a2e1
commit 044a3cfdb3
@@ -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.