diff --git a/addons/mass_mailing/views/snippets_themes.xml b/addons/mass_mailing/views/snippets_themes.xml index 2af82cdf676..333964b98c0 100644 --- a/addons/mass_mailing/views/snippets_themes.xml +++ b/addons/mass_mailing/views/snippets_themes.xml @@ -423,6 +423,7 @@ data-exclude=".o_mail_no_colorpicker, .o_mail_no_options"> @@ -433,6 +434,7 @@ data-target=".card"> diff --git a/addons/web_editor/static/src/js/editor/snippets.options.js b/addons/web_editor/static/src/js/editor/snippets.options.js index b06a8bc726c..b320622ff33 100644 --- a/addons/web_editor/static/src/js/editor/snippets.options.js +++ b/addons/web_editor/static/src/js/editor/snippets.options.js @@ -1485,6 +1485,10 @@ const ColorpickerUserValueWidget = SelectUserValueWidget.extend({ if (this.options.dataAttributes.withGradients) { options.withGradients = !!this.options.dataAttributes.withGradients; } + if (this.options.dataAttributes.noTransparency) { + options.noTransparency = !!this.options.dataAttributes.noTransparency; + options.excluded = [...(options.excluded || []), 'transparent_grayscale']; + } if (this.options.dataAttributes.selectedTab) { options.selectedTab = this.options.dataAttributes.selectedTab; } 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 dbe54e9132f..d39934cf052 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 @@ -45,6 +45,7 @@ const ColorPaletteWidget = Widget.extend({ * @param {string[]} [options.excluded=[]] Sections not to display. * @param {string[]} [options.excludeSectionOf] Extra section to exclude: the one containing the named color. * @param {boolean} [options.withCombinations=false] Enable color combinations selection. + * @param {float} [options.noTransparency=false] Specify a default opacity (predefined gradients & color). * @param {float} [options.opacity=1] Specify a default opacity (predefined gradients & color). * @param {string} [options.selectedTab='theme-colors'] Tab initially selected. * @param {boolean} [options.withGradients=false] Enable gradient selection. @@ -60,6 +61,7 @@ const ColorPaletteWidget = Widget.extend({ excludeSectionOf: null, $editable: $(), withCombinations: false, + noTransparency: false, opacity: 1, selectedTab: 'theme-colors', withGradients: false, @@ -294,6 +296,7 @@ const ColorPaletteWidget = Widget.extend({ } this.colorPicker = new ColorpickerWidget(this, { defaultColor: defaultColor, + noTransparency: !!this.options.noTransparency, }); await this.colorPicker.appendTo(this.sections['custom-colors']); }