From 947fc39d4c0f980ee3f0748cfe216c335edac925 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Geelen=20=28sge=29?= Date: Mon, 30 Nov 2020 15:46:39 +0000 Subject: [PATCH] [IMP] web_editor: remove message before leaving page if editor is destro closes odoo/odoo#62630 Signed-off-by: David Monjoie (dmo) --- addons/web_editor/static/src/js/wysiwyg/wysiwyg.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js b/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js index b7e9cc03c49..2127166f029 100644 --- a/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js +++ b/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js @@ -450,6 +450,9 @@ var Wysiwyg = Widget.extend({ * @override */ destroy: function () { + // Saving the content of the editor is not possible after destroy, + // so there's no need to keep the pop-up warning in this case. + window.onbeforeunload = null; this.editor.stop(); this._super(); },