Learn: fix alert notification
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user