summaryrefslogtreecommitdiff
path: root/addons/website/static/src/js
diff options
context:
space:
mode:
Diffstat (limited to 'addons/website/static/src/js')
-rw-r--r--addons/website/static/src/js/editor/snippets.options.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/addons/website/static/src/js/editor/snippets.options.js b/addons/website/static/src/js/editor/snippets.options.js
index e6e075e1309..5225c57b249 100644
--- a/addons/website/static/src/js/editor/snippets.options.js
+++ b/addons/website/static/src/js/editor/snippets.options.js
@@ -2321,8 +2321,15 @@ options.registry.CoverProperties = options.Class.extend({
updateUI: async function () {
await this._super(...arguments);
+ // TODO: `o_record_has_cover` should be handled using model field, not
+ // resize_class to avoid all of this.
+ let coverClass = this.$el.find('[data-cover-opt-name="size"] we-button.active').data('selectClass') || '';
+ const bg = this.$image.css('background-image');
+ if (bg && bg !== 'none') {
+ coverClass += " o_record_has_cover";
+ }
// Update saving dataset
- this.$target[0].dataset.coverClass = this.$el.find('[data-cover-opt-name="size"] we-button.active').data('selectClass') || '';
+ this.$target[0].dataset.coverClass = coverClass;
this.$target[0].dataset.textAlignClass = this.$el.find('[data-cover-opt-name="text_align"] we-button.active').data('selectClass') || '';
this.$target[0].dataset.filterValue = this.$filterValueOpts.filter('.active').data('filterValue') || 0.0;
let colorPickerWidget = null;