mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-11-08 07:21:03 +08:00
Fix navigating away with unsaved TinyMCE changes [SCI-7776]
This commit is contained in:
parent
f455b8fb32
commit
b46c92b3c6
1 changed files with 4 additions and 2 deletions
6
app/javascript/packs/tiny_mce.js
vendored
6
app/javascript/packs/tiny_mce.js
vendored
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue