summaryrefslogtreecommitdiff
path: root/addons/web_editor/static
diff options
context:
space:
mode:
authorqsm-odoo <qsm@odoo.com>2021-01-27 14:06:50 +0000
committerqsm-odoo <qsm@odoo.com>2021-01-27 14:11:36 +0000
commit8f9eb57df5c6a253ee0702c0e1fb2016cab7eb1e (patch)
tree61641c9325dd62fbb094f521e84bcb2a341264da /addons/web_editor/static
parent2172295cefa1d8780332709bf0c97cfa23def3a5 (diff)
[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#65139 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Diffstat (limited to 'addons/web_editor/static')
-rw-r--r--addons/web_editor/static/src/js/wysiwyg/widgets/color_palette.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/addons/web_editor/static/src/js/wysiwyg/widgets/color_palette.js b/addons/web_editor/static/src/js/wysiwyg/widgets/color_palette.js
index 25e8dfa2835..ff5fa4b0a75 100644
--- a/addons/web_editor/static/src/js/wysiwyg/widgets/color_palette.js
+++ b/addons/web_editor/static/src/js/wysiwyg/widgets/color_palette.js
@@ -144,6 +144,13 @@ const ColorPaletteWidget = Widget.extend({
defaultColor: defaultColor,
});
await this.colorPicker.prependTo($colorSection);
+
+ // TODO Added as a fix. In master, the widget should probably not be
+ // instantiated at all.
+ if (this.options.excluded.includes('custom')) {
+ this.colorPicker.$el.addClass('d-none');
+ }
+
return res;
},
/**