From 2f8cb75f0ddafb6914e9bc21480eb89cd1cfaa63 Mon Sep 17 00:00:00 2001 From: Dhaval Baraiya Date: Tue, 2 Aug 2022 05:03:47 +0000 Subject: [PATCH] [FIX] web_editor: specify a custom color in the text input of the color picker. Before this commit: It's impossible to specify a custom color in the text input of the color picker for the selected text. After this commit: It's possible to specify a custom color in the text input of the color picker for the selected text. Task-2896109 closes odoo/odoo#104560 X-original-commit: f1f3fcef6cc471fc01da574da26712e643315da6 Signed-off-by: David Monjoie (dmo) --- .../static/src/js/editor/odoo-editor/src/OdooEditor.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/web_editor/static/src/js/editor/odoo-editor/src/OdooEditor.js b/addons/web_editor/static/src/js/editor/odoo-editor/src/OdooEditor.js index f5577eb579d..5a5150d3808 100644 --- a/addons/web_editor/static/src/js/editor/odoo-editor/src/OdooEditor.js +++ b/addons/web_editor/static/src/js/editor/odoo-editor/src/OdooEditor.js @@ -2533,7 +2533,7 @@ export class OdooEditor extends EventTarget { } } } - if (this.options.autohideToolbar) { + if (this.options.autohideToolbar && !this.toolbar.contains(sel.anchorNode)) { if (show !== undefined && !this.isMobile) { this.toolbar.style.visibility = show ? 'visible' : 'hidden'; } @@ -2650,7 +2650,7 @@ export class OdooEditor extends EventTarget { undoButton && undoButton.classList.toggle('disabled', !this.historyCanUndo()); const redoButton = this.toolbar.querySelector('#redo'); redoButton && redoButton.classList.toggle('disabled', !this.historyCanRedo()); - if (this.options.autohideToolbar && !this.isMobile) { + if (this.options.autohideToolbar && !this.isMobile && !this.toolbar.contains(sel.anchorNode)) { this._positionToolbar(); } }