Learn: fix alert notification

This commit is contained in:
2026-09-17 18:55:57 +03:00
parent 57052ed117
commit 80f551745a

View File

@@ -116,6 +116,11 @@
if (event.target && event.target.id === 'article-body') dirty = true;
});
/* Сохранение — это осознанный уход со страницы, подтверждение не нужно */
document.addEventListener('submit', function (event) {
if (event.target && event.target.id === 'article-edit') dirty = false;
}, true);
window.addEventListener('beforeunload', function (event) {
var form = document.getElementById('article-edit');
if (dirty && form && !form.hidden) {