[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) <qsm@odoo.com>
This commit is contained in:
Benjamin Vray
2022-02-24 12:33:04 +00:00
parent fdba641a07
commit 169dd13df3
@@ -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];