[FIX] web_editor: properly hide the custom colors section if needed

The 'custom' key was not working anymore as a key to exclude the
ability to choose a custom color from a color palette widget. It was
thus appearing for choosing the transparent color for over-the-content
headers... which is not possible to save right now.

Part of https://github.com/odoo/odoo/pull/65139

closes odoo/odoo#65154

X-original-commit: 8f9eb57df5c6a253ee0702c0e1fb2016cab7eb1e
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
This commit is contained in:
qsm-odoo
2021-01-27 17:37:23 +00:00
parent f9479738a2
commit 1c1894d6d9
@@ -136,14 +136,17 @@ const ColorPaletteWidget = Widget.extend({
this._markSelectedColor();
// Colorpicker
let defaultColor = this.selectedColor;
if (defaultColor && !ColorpickerWidget.isCSSColor(defaultColor)) {
defaultColor = weUtils.getCSSVariableValue(defaultColor, this.style);
if (!this.options.excluded.includes('custom')) {
let defaultColor = this.selectedColor;
if (defaultColor && !ColorpickerWidget.isCSSColor(defaultColor)) {
defaultColor = weUtils.getCSSVariableValue(defaultColor, this.style);
}
this.colorPicker = new ColorpickerWidget(this, {
defaultColor: defaultColor,
});
await this.colorPicker.prependTo($colorSection);
}
this.colorPicker = new ColorpickerWidget(this, {
defaultColor: defaultColor,
});
await this.colorPicker.prependTo($colorSection);
return res;
},
/**