From ff283b6b1ab17a22921bb267388ff1e503fa3c41 Mon Sep 17 00:00:00 2001 From: maad-odoo Date: Thu, 16 Feb 2023 06:48:08 +0000 Subject: [PATCH] [FIX] web_editor: unlink toolbar button is displayed when range is collapsed Before this commit: In mobile view, when text as well as link is in range the unlink button in the toolbar was visible. After this commit: The unlink button is only displayed when link is in range Task-3184393 closes odoo/odoo#115161 X-original-commit: 5cab1c90b13074e642f3da3a773c55d37419f90b Signed-off-by: David Monjoie (dmo) --- .../src/js/editor/odoo-editor/src/OdooEditor.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 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 7b07adc4f18..2c699d2423f 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 @@ -2731,11 +2731,13 @@ export class OdooEditor extends EventTarget { } } if (this.options.autohideToolbar && !this.toolbar.contains(sel.anchorNode)) { - if (show !== undefined && !this.isMobile) { - this.toolbar.style.visibility = show ? 'visible' : 'hidden'; - } - if (show === false) { - return; + if (!this.isMobile) { + if (show !== undefined) { + this.toolbar.style.visibility = show ? 'visible' : 'hidden'; + } + if (show === false) { + return; + } } } if (!this.isSelectionInEditable(sel)) {