From a67f7df31a9e5a5550d54d52ae506299f4a62581 Mon Sep 17 00:00:00 2001 From: Benjamin Vray Date: Fri, 20 Nov 2020 09:27:49 +0000 Subject: [FIX] web_editor: close open invisible elements before deleting it Before this commit, open invisible elements were not closed before being deleted. This created issues like the 'modal-open' class wich was not removed from the body when removing a modal. Part of https://github.com/odoo/odoo/pull/61998 task-2312878 --- addons/web_editor/static/src/js/editor/snippets.editor.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'addons/web_editor/static/src/js') 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 f19764dce46..0ebf68345e1 100644 --- a/addons/web_editor/static/src/js/editor/snippets.editor.js +++ b/addons/web_editor/static/src/js/editor/snippets.editor.js @@ -297,6 +297,8 @@ var SnippetEditor = Widget.extend({ removeSnippet: async function () { this.toggleOverlay(false); this.toggleOptions(false); + // If it is an invisible element, we must close it before deleting it (e.g. modal) + await this.toggleTargetVisibility(!this.$target.hasClass('o_snippet_invisible')); await new Promise(resolve => { this.trigger_up('call_for_each_child_snippet', { -- cgit v1.2.3