diff options
| author | qsm-odoo <qsm@odoo.com> | 2019-10-31 14:38:09 +0000 |
|---|---|---|
| committer | qsm-odoo <qsm@odoo.com> | 2019-11-18 09:56:40 +0000 |
| commit | c879ac723b341b951dd464f0a147012f36b912f7 (patch) | |
| tree | 56ef420fbfa3c3928adc1d687afec98d72bcda67 /addons/web_editor/static/src | |
| parent | ea994b0cbb81597ccc7be1765018223c3a6c986c (diff) | |
[FIX] website, *: no theme color suggestions during theme colors edition
* web_editor
Part of https://github.com/odoo/odoo/pull/38959
task-2066614
Diffstat (limited to 'addons/web_editor/static/src')
| -rw-r--r-- | addons/web_editor/static/src/js/wysiwyg/widgets/color_palette.js | 5 |
1 files changed, 5 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 5c5ab0ca866..ed37d65f096 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 @@ -31,6 +31,7 @@ const ColorPaletteWidget = Widget.extend({ * @param {string} [options.colorPrefix='bg-'] Used for the class based colors (theme). * @param {boolean} [options.resetButton=true] Whether to display or not the reset button. * @param {string[]} [options.excluded=[]] Sections not to display. + * @param {string[]} [options.excludeSectionOf] Extra section to exclude: the one containing the named color. * @param {JQuery} [options.$editable=$()] Editable content from which the custom colors are retrieved. */ init: function (parent, options) { @@ -42,6 +43,7 @@ const ColorPaletteWidget = Widget.extend({ colorPrefix: 'bg-', resetButton: true, excluded: [], + excludeSectionOf: null, $editable: $(), }, options || {}); @@ -86,6 +88,9 @@ const ColorPaletteWidget = Widget.extend({ _.each(this.options.excluded, function (exc) { $wrapper.find('[data-name="' + exc + '"]').remove(); }); + if (this.options.excludeSectionOf) { + $wrapper.find('[data-name]:has([data-color="' + this.options.excludeSectionOf + '"])').remove(); + } // Render common colors if (!this.options.excluded.includes('common')) { |
