From 4a9d7e5554f059af322acfcbe48152011947629d Mon Sep 17 00:00:00 2001 From: "Guillaume (gdi)" Date: Tue, 3 Jan 2023 10:11:07 +0000 Subject: [PATCH] [FIX] web_editor: correctly position the blocks tooltips Since [this commit], a tooltip is displayed on the blocks that can be dropped in a page so that the user understands that he must not just click on it but drag and drop the block. Unfortunately, these tooltips were not well positioned in the email marketing application because the editor is in an iframe in this application. This commit allows to position correctly these tooltips. Steps to reproduce the bug fixed by this commit: - Go to the email marketing application - Create a new mail - Select a template other than "plain text". - Triple click on a block => The tootlip is displayed way too high. [this commit]: https://github.com/odoo/odoo/commit/a50c09e3b432d7601cd0e02cbbfabe24a67ba70f task-2777738 closes odoo/odoo#111011 X-original-commit: 42d32a4f40d685e10f2ae4bb678df2009cb4bd21 Signed-off-by: Romain Derie (rde) --- addons/web_editor/static/src/js/editor/snippets.editor.js | 4 ++++ 1 file changed, 4 insertions(+) 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 95db4aee725..1576c59e845 100644 --- a/addons/web_editor/static/src/js/editor/snippets.editor.js +++ b/addons/web_editor/static/src/js/editor/snippets.editor.js @@ -2823,6 +2823,10 @@ var SnippetsMenu = Widget.extend({ trigger: 'manual', placement: 'bottom', title: _t("Drag and drop the building block."), + // Ensure the tooltips have a good position when in iframe. + container: this.el, + // Prevent horizontal scroll when tooltip is displayed. + boundary: this.el.ownerDocument.body, }); // Hide scroll if no snippets defined