diff options
| author | Siddarth Gajjar <sga@odoo.com> | 2020-12-31 14:24:35 +0000 |
|---|---|---|
| committer | qsm-odoo <qsm@odoo.com> | 2020-12-31 14:43:41 +0000 |
| commit | be5f3bdfe5f593e2f3998f93b98b9f43e1658ee6 (patch) | |
| tree | 6cdc3aed8f7ec6d7a33120a58118d602d7b59ace /addons/website/static | |
| parent | c11e0fe2673fd18e6db45fd18a153042d525990a (diff) | |
[FIX] website: fix blog post / event title color
Before this commit, due to change in cover option refactoring at [1],
class 'o_record_has_cover' was removed from default configuration and
may not be saved properly.
[1]: https://github.com/odoo/odoo/commit/da32bdb88a4726a0dcee73f2c505ef5ea68c72ef
task-2387990
closes odoo/odoo#62004
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Diffstat (limited to 'addons/website/static')
| -rw-r--r-- | addons/website/static/src/js/editor/snippets.options.js | 9 |
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; |
