Skip to content

Commit 0995790

Browse files
authored
Merge pull request mautic#15195 from andersonjeccel/fix-ckeditor-modal-issue
Fix CKEditor destruction when trigger event modals are closed
2 parents 6302d29 + e804b7c commit 0995790

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

app/bundles/CoreBundle/Assets/js/1a.content.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -818,9 +818,11 @@ Mautic.onPageUnload = function (container, response) {
818818

819819
if (ckEditors.size > 0) {
820820
ckEditors.forEach(function(value, key, map){
821-
map.get(key).destroy()
822-
})
823-
ckEditors.clear();
821+
if (container === '#app-content' || container === 'body' || mQuery(container).find(key).length > 0 || mQuery(key).closest(container).length > 0) {
822+
map.get(key).destroy();
823+
map.delete(key);
824+
}
825+
});
824826
}
825827

826828
mQuery(container + " input[data-toggle='color']").each(function() {

0 commit comments

Comments
 (0)