[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
This commit is contained in:
Benjamin Vray
2021-09-16 10:01:06 +00:00
committed by qsm-odoo
parent a04ce99689
commit c0dcc8265b
@@ -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;
}