Fix navigating away with unsaved TinyMCE changes [SCI-7776]

This commit is contained in:
Martin Artnik 2023-01-18 11:00:08 +01:00
parent f455b8fb32
commit b46c92b3c6

View file

@ -464,10 +464,12 @@ $(document).on('turbolinks:before-visit', (e) => {
if (editor === null) return true;
if (editor.isNotDirty === false) {
if (editor.isDirty()) {
// eslint-disable-next-line no-alert
if (confirm(I18n.t('tiny_mce.leaving_warning'))) {
return false;
$('.atwho-container').remove();
tinyMCE.activeEditor.remove();
return true;
}
e.preventDefault();
return false;