From 169dd13df39d7708db6b310fdfa7f007232256f5 Mon Sep 17 00:00:00 2001 From: Benjamin Vray Date: Tue, 22 Feb 2022 10:58:07 +0000 Subject: [PATCH] [FIX] web_editor: fix cover when there is modal inside a snippet Since this commit [1], we considered that if a snippet contained a modal, it is that the overlay had to cover the modal itself. But that is not correct, because in some cases a snippet can contain closed modals (e.g. the course page in the website slides module contains modals). After this commit, we avoid applying an overlay on a modal that is not open. [1]: https://github.com/odoo/odoo/commit/bc055e7822b9b2e7f8f9608e335456a71d7896a1 task-2710582 closes odoo/odoo#85240 X-original-commit: 9f3eac25b1806d13e270902848c6ead523c7e6bc Signed-off-by: Quentin Smetz (qsm) --- 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 c30d4ab0f5a..0f7879c6214 100644 --- a/addons/web_editor/static/src/js/editor/snippets.editor.js +++ b/addons/web_editor/static/src/js/editor/snippets.editor.js @@ -333,7 +333,7 @@ var SnippetEditor = Widget.extend({ return; } - const $modal = this.$target.find('.modal'); + const $modal = this.$target.find('.modal:visible'); const $target = $modal.length ? $modal : this.$target; const targetEl = $target[0];