summaryrefslogtreecommitdiff
path: root/addons/website
diff options
context:
space:
mode:
authorDramixDw <rve@odoo.com>2020-06-08 15:08:31 +0000
committerqsm-odoo <qsm@odoo.com>2020-07-15 11:36:56 +0000
commitda32bdb88a4726a0dcee73f2c505ef5ea68c72ef (patch)
tree7733c8c8ba38042afce4d544af306b45801e746c /addons/website
parent188c338ab2d731f001f4d5b35fa3fdba1efad7c7 (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')
-rw-r--r--addons/website/static/src/js/editor/snippets.options.js5
-rw-r--r--addons/website/views/snippets/snippets.xml6
2 files changed, 5 insertions, 6 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);
},
diff --git a/addons/website/views/snippets/snippets.xml b/addons/website/views/snippets/snippets.xml
index dd342b4c0be..3bde97b34e4 100644
--- a/addons/website/views/snippets/snippets.xml
+++ b/addons/website/views/snippets/snippets.xml
@@ -614,9 +614,9 @@
<t t-set="with_color_combinations" t-value="True"/>
</t>
<we-select string="Size" data-cover-opt-name="size">
- <we-button data-select-class="o_record_has_cover o_full_screen_height">Full Screen</we-button>
- <we-button class="o_record_cover_opt_size_default" data-select-class="o_record_has_cover o_half_screen_height">Half Screen</we-button>
- <we-button data-select-class="o_record_has_cover cover_auto">Fit text</we-button>
+ <we-button data-select-class="o_full_screen_height">Full Screen</we-button>
+ <we-button class="o_record_cover_opt_size_default" data-select-class="o_half_screen_height">Half Screen</we-button>
+ <we-button data-select-class="cover_auto">Fit text</we-button>
</we-select>
<we-select string="Filter Intensity" data-cover-opt-name="filters">
<we-button data-filter-value="0.0">None</we-button>