From 5afaeef8643ecc2ee8fe5f1b7e2a8839d6ee6010 Mon Sep 17 00:00:00 2001 From: Benjamin Vray Date: Mon, 6 Sep 2021 13:53:51 +0000 Subject: [PATCH] [FIX] website_sale: fix text color preview of ribbons Before this commit, the text color preview of the ribbons in the ribbon selector was wrong. But also, if we selected another ribbon just after changing the text color of a ribbon. This color was applied to the selected ribbon. task-2501515 X-original-commit: 19252137588b30a69ce57f0248a504f7e929b98e Part-of: odoo/odoo#77412 --- addons/website_sale/static/src/js/website_sale.editor.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/website_sale/static/src/js/website_sale.editor.js b/addons/website_sale/static/src/js/website_sale.editor.js index facff49b1ed..5d068b7416d 100644 --- a/addons/website_sale/static/src/js/website_sale.editor.js +++ b/addons/website_sale/static/src/js/website_sale.editor.js @@ -447,7 +447,7 @@ options.registry.WebsiteSaleProductsItem = options.Class.extend({ $ribbons.removeClass(htmlClasses); $ribbons.addClass(ribbon.html_class || ''); - $ribbons.css('color', ribbon.text_color); + $ribbons.css('color', ribbon.text_color || ''); $ribbons.css('background-color', ribbon.bg_color || ''); if (!this.ribbons[widgetValue]) { @@ -605,7 +605,7 @@ options.registry.WebsiteSaleProductsItem = options.Class.extend({ colorClasses, isTag: /o_tag_(left|right)/.test(ribbon.html_class), isLeft: /o_(tag|ribbon)_left/.test(ribbon.html_class), - textColor: ribbon.text_color || colorClasses ? 'currentColor' : defaultTextColor, + textColor: ribbon.text_color || (colorClasses ? 'currentColor' : defaultTextColor), })); }); },