diff options
| author | DramixDw <rve@odoo.com> | 2020-06-08 15:08:31 +0000 |
|---|---|---|
| committer | qsm-odoo <qsm@odoo.com> | 2020-07-15 11:36:56 +0000 |
| commit | da32bdb88a4726a0dcee73f2c505ef5ea68c72ef (patch) | |
| tree | 7733c8c8ba38042afce4d544af306b45801e746c /addons/website/static/src/js/editor/snippets.options.js | |
| parent | 188c338ab2d731f001f4d5b35fa3fdba1efad7c7 (diff) | |
[IMP] website, *: make cover options always available
*: website_blog, website_event
It would make sense to be able to change the height of a cover or to
change the text alignment even if there's no backgroung-image.
Therefore, we're removing the background-image restriction for the
options of the cover snippet.
Part of https://github.com/odoo/odoo/pull/47933
task-2210733
closes odoo/odoo#47933
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Diffstat (limited to 'addons/website/static/src/js/editor/snippets.options.js')
| -rw-r--r-- | addons/website/static/src/js/editor/snippets.options.js | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/addons/website/static/src/js/editor/snippets.options.js b/addons/website/static/src/js/editor/snippets.options.js index e698c503ace..9c405641cc7 100644 --- a/addons/website/static/src/js/editor/snippets.options.js +++ b/addons/website/static/src/js/editor/snippets.options.js @@ -2020,6 +2020,7 @@ options.registry.CoverProperties = options.Class.extend({ this.$target.removeClass('o_record_has_cover'); } else { this.$image.css('background-image', `url('${widgetValue}')`); + this.$target.addClass('o_record_has_cover'); const $defaultSizeBtn = this.$el.find('.o_record_cover_opt_size_default'); $defaultSizeBtn.click(); $defaultSizeBtn.closest('we-select').click(); @@ -2084,10 +2085,8 @@ options.registry.CoverProperties = options.Class.extend({ * @override */ _computeWidgetVisibility: function (widgetName, params) { - const hasCover = this.$target.hasClass('o_record_has_cover'); if (params.coverOptName) { - var notAllowed = (this.$target.data(`use_${params.coverOptName}`) !== 'True'); - return (hasCover && !notAllowed); + return this.$target.data(`use_${params.coverOptName}`) === 'True'; } return this._super(...arguments); }, |
