[FIX] web_editor: allow to change primary and secondary bg classes
closes odoo/odoo#36849 X-original-commit: 6d6cf6128e6d36830b339de9b8957717201c2f02 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
This commit is contained in:
@@ -703,6 +703,17 @@ registry.colorpicker = SnippetOption.extend({
|
||||
}
|
||||
|
||||
var bgColor = ColorpickerDialog.formatColor(self.$target.css('background-color'));
|
||||
|
||||
// TODO refactor in master
|
||||
// The primary and secondary are hardcoded here (but marked as hidden)
|
||||
// so they can be removed from snippets when selecting another color.
|
||||
// Normally, the chosable colors do not contain them, which prevents
|
||||
// them to be removed. Indeed, normally, the 'alpha' and 'beta' colors
|
||||
// (which are the same) are displayed instead... but not for all themes.
|
||||
var $colorpicker = this.$el.find('.colorpicker');
|
||||
$colorpicker.append($('<button/>', {'class': 'd-none', 'data-color': 'primary'}));
|
||||
$colorpicker.append($('<button/>', {'class': 'd-none', 'data-color': 'secondary'}));
|
||||
|
||||
var classes = [];
|
||||
this.$el.find('.colorpicker button').each(function () {
|
||||
var $color = $(this);
|
||||
|
||||
Reference in New Issue
Block a user