From c0dcc8265bbfb35c93eea11e16d87763c1793cd9 Mon Sep 17 00:00:00 2001 From: Benjamin Vray Date: Fri, 10 Sep 2021 06:52:24 +0000 Subject: [PATCH] [FIX] web_editor: not hide the toolbar container by clicking in itself Before this commit, the toolbar container was closed when we clicked on its background or in its title bar. task-2545252 X-original-commit: 2ca87a5142a03540fc5e6428530d394faa223d17 Part-of: odoo/odoo#76610 --- addons/web_editor/static/src/js/editor/snippets.editor.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/web_editor/static/src/js/editor/snippets.editor.js b/addons/web_editor/static/src/js/editor/snippets.editor.js index 65b3fb26a97..0f9adacdfe4 100644 --- a/addons/web_editor/static/src/js/editor/snippets.editor.js +++ b/addons/web_editor/static/src/js/editor/snippets.editor.js @@ -3169,8 +3169,8 @@ var SnippetsMenu = Widget.extend({ const docSelection = document.getSelection(); const $currentSelectionTarget = docSelection && docSelection.rangeCount > 0 ? $(docSelection.getRangeAt(0).commonAncestorContainer) : $(); // Do not toggle visibility if the target is inside the toolbar ( eg. during link edition). - if ($currentSelectionTarget.parents('#toolbar').length || - (e && $(e.target).parents('#toolbar').length) + if ($currentSelectionTarget.closest('#o_we_editor_toolbar_container').length || + (e && $(e.target).closest('#o_we_editor_toolbar_container').length) ) { return; }