[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) <dmo@odoo.com>
This commit is contained in:
Dhaval Baraiya
2022-11-03 13:10:46 +01:00
committed by dhba-odoo
parent a8ab288276
commit 2f8cb75f0d
@@ -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();
}
}