Skip to content
Snippets Groups Projects
Commit 3422b96a authored by Jitendra Prajapati's avatar Jitendra Prajapati Committed by fw-bot
Browse files

[FIX] web_editor: fixed the traceback on close modal dialog


The issue here is, for modal dialogs (eg newsletter popup), when we close
the dialog, the modal is destroyed and so after the delayed execution due to
timeout, the dialog will not be available and it will generate the issue.

removed delayed execution for the traceback, which is relevant to
the modal dialogs.

task-2075232

closes odoo/odoo#38914

X-original-commit: 93deb25f
Signed-off-by: default avatarDavid Monjoie (dmo) <dmo@odoo.com>
parent d534cc71
Branches
Tags
No related merge requests found
......@@ -674,13 +674,19 @@ var RTEWidget = Widget.extend({
if (this && this.$last && (!$editable.length || this.$last[0] !== $editable[0])) {
var $destroy = this.$last;
history.splitNext();
_.delay(function () {
// In some special cases, we need to clear the timeout.
var lastTimerId = _.delay(function () {
var id = $destroy.data('note-id');
$destroy.destroy().removeData('note-id').removeAttr('data-note-id');
$('#note-popover-'+id+', #note-handle-'+id+', #note-dialog-'+id+'').remove();
}, 150); // setTimeout to remove flickering when change to editable zone (re-create an editor)
this.$last = null;
// for modal dialogs (eg newsletter popup), when we close the dialog, the modal is
// destroyed immediately and so after the delayed execution due to timeout, dialog will
// not be available, leading to trace-back, so we need to clearTimeout for the dialogs.
if ($destroy.hasClass('modal-body')) {
clearTimeout(lastTimerId);
}
}
if ($editable.length && (!this.$last || this.$last[0] !== $editable[0])) {
$editable.summernote(this._getConfig($editable));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment