From 002cdcab0a26212ddee0929dc0e54093138d7dc5 Mon Sep 17 00:00:00 2001 From: Antoine Guenet Date: Fri, 23 Apr 2021 13:15:58 +0000 Subject: [PATCH] [FIX] web_editor: show/hide toolbar on click in editor document We need to check the selection on click in the editor's document so as to update the visibility of the toolbar (we want to hide it if the selection is in a non-editable area). When the editor was in an iframe however, the wrong document was targeted: we want to check on clicks in the editor's document, not the top document. closes odoo/odoo#69775 X-original-commit: b0429c96e30751390991a9471a4c031dfed98d81 Signed-off-by: David Monjoie (dmo) --- addons/web_editor/static/src/js/editor/snippets.editor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 ef927c85846..01f784f8e53 100644 --- a/addons/web_editor/static/src/js/editor/snippets.editor.js +++ b/addons/web_editor/static/src/js/editor/snippets.editor.js @@ -1168,7 +1168,7 @@ var SnippetsMenu = Widget.extend({ this.customizePanel.classList.add('o_we_customize_panel', 'd-none'); this._addToolbar(); this._checkEditorToolbarVisibilityCallback = this._checkEditorToolbarVisibility.bind(this) - $(document.body).on('click', this._checkEditorToolbarVisibilityCallback); + $(this.options.wysiwyg.odooEditor.document.body).on('click', this._checkEditorToolbarVisibilityCallback); if (this.options.enableTranslation) { // Load the sidebar with the style tab only.