diff options
| author | qsm-odoo <qsm@odoo.com> | 2019-11-20 16:55:27 +0000 |
|---|---|---|
| committer | qsm-odoo <qsm@odoo.com> | 2019-11-27 09:36:27 +0000 |
| commit | fbdc541f9c4f4584235ec04d44d438b0675ffe97 (patch) | |
| tree | 95c51c6fe5b5bf564ae1775a5a05bbd3ef8ca419 /addons | |
| parent | 25dc18bb0979cf4f48fb99911af026768852cd70 (diff) | |
[FIX] web_editor: read both color and bg-color to find custom ones
This was broken during the recent colorpicker refactoring.
closes odoo/odoo#40925
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/web_editor/static/src/js/wysiwyg/widgets/color_palette.js | 10 |
1 files changed, 6 insertions, 4 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 ed37d65f096..f73c88a3a25 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 @@ -157,10 +157,12 @@ const ColorPaletteWidget = Widget.extend({ const existingColors = new Set(this.summernoteCustomColorsArray.concat(Array.from(this.el.querySelectorAll('.o_custom_color')).map(el => el.style.backgroundColor))); if (!this.options.excluded.includes('custom')) { Array.from(this.options.$editable.find('[style*="color"]')).forEach(el => { - const color = el.style.color || el.style.backgroundColor; - if (color && !existingColors.has(color)) { - this._addCustomColorButton(color); - existingColors.add(color); + for (const colorProp of ['color', 'backgroundColor']) { + const color = el.style[colorProp]; + if (color && !existingColors.has(color)) { + this._addCustomColorButton(color); + existingColors.add(color); + } } }); } |
