From 6534c4f2ce972eee506aa94527d3e9d107a1779a Mon Sep 17 00:00:00 2001 From: "Guillaume (gdi)" Date: Tue, 4 Oct 2022 15:03:45 +0200 Subject: [PATCH] [IMP] website: allow all background colors for over the content headers This commit allows users to choose any background color for nav bars that are over the content. Before this commit the available colors were: - bg-black-{15/25/50/75} - bg-white-{25/50/75/85} Now the users can choose any color (except gradients). task-2904507 Part-of: odoo/odoo#99732 Co-authored-by: jpr-odoo --- addons/website/static/src/js/editor/snippets.options.js | 6 ++++-- addons/website/views/snippets/snippets.xml | 2 +- addons/website/views/website_templates.xml | 9 ++++++++- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/addons/website/static/src/js/editor/snippets.options.js b/addons/website/static/src/js/editor/snippets.options.js index 6e8ab0a57e0..c2f65fd4026 100644 --- a/addons/website/static/src/js/editor/snippets.options.js +++ b/addons/website/static/src/js/editor/snippets.options.js @@ -2599,11 +2599,13 @@ options.registry.topMenuColor = options.Class.extend({ */ async selectStyle(previewMode, widgetValue, params) { await this._super(...arguments); - const className = widgetValue ? (params.colorPrefix + widgetValue) : ''; + if (widgetValue && !isCSSColor(widgetValue)) { + widgetValue = params.colorPrefix + widgetValue; + } await new Promise((resolve, reject) => { this.trigger_up('action_demand', { actionName: 'toggle_page_option', - params: [{name: 'header_color', value: className}], + params: [{name: 'header_color', value: widgetValue}], onSuccess: resolve, onFailure: reject, }); diff --git a/addons/website/views/snippets/snippets.xml b/addons/website/views/snippets/snippets.xml index 975fedfb602..b47c4f3d759 100644 --- a/addons/website/views/snippets/snippets.xml +++ b/addons/website/views/snippets/snippets.xml @@ -892,7 +892,7 @@ data-prevent-important="true" data-css-property="background-color" data-color-prefix="bg-" - data-excluded="theme, common, custom"/> + data-excluded="theme, common"/> diff --git a/addons/website/views/website_templates.xml b/addons/website/views/website_templates.xml index 5378fd47b5f..0853d28050f 100644 --- a/addons/website/views/website_templates.xml +++ b/addons/website/views/website_templates.xml @@ -197,6 +197,12 @@ + + + + + +
@@ -219,7 +225,8 @@ - + +