summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src
diff options
context:
space:
mode:
authorqsm-odoo <qsm@odoo.com>2019-12-18 17:07:16 +0000
committerqsm-odoo <qsm@odoo.com>2019-12-19 10:06:29 +0000
commitd08023f06ae8c211a83414b9164e4c7bcb0f6367 (patch)
tree5cf52ebaa564bde9eac1904d345c58dbd2e2f745 /addons/web_editor/static/src
parente51358b8cec2e2fd763b3a07ddc3a9b504116ea1 (diff)
[FIX] web_editor: close widgets before updating the left panel
Part of https://github.com/odoo/odoo/pull/42136
Diffstat (limited to 'addons/web_editor/static/src')
-rw-r--r--addons/web_editor/static/src/js/editor/snippets.editor.js9
1 files changed, 8 insertions, 1 deletions
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 41d5dbb81b6..5d2fb049ea0 100644
--- a/addons/web_editor/static/src/js/editor/snippets.editor.js
+++ b/addons/web_editor/static/src/js/editor/snippets.editor.js
@@ -1263,6 +1263,12 @@ var SnippetsMenu = Widget.extend({
return Promise.all(defs);
},
/**
+ * @private
+ */
+ _closeWidgets: function () {
+ this.snippetEditors.forEach(editor => editor.closeWidgets());
+ },
+ /**
* Creates and returns a set of helper functions which can help finding
* snippets in the DOM which match some parameters (typically parameters
* given by a snippet option). The functions are:
@@ -1966,6 +1972,7 @@ var SnippetsMenu = Widget.extend({
* @param {OdooEvent} ev
*/
_onUpdateCustomizeElements: function (ev) {
+ this._closeWidgets();
while (this.customizePanel.firstChild) {
this.customizePanel.removeChild(this.customizePanel.firstChild);
}
@@ -1983,7 +1990,7 @@ var SnippetsMenu = Widget.extend({
* user value widgets of all editors.
*/
_onUserValueWidgetOpening: function () {
- this.snippetEditors.forEach(editor => editor.closeWidgets());
+ this._closeWidgets();
},
});