Attempt to stop navigation when there is an edit in progress. This fixes #16
This commit is contained in:
parent
6d56ad0001
commit
3ca84dbb4e
1 changed files with 7 additions and 0 deletions
|
@ -103,6 +103,13 @@ function openEditor() {
|
||||||
form.reset();
|
form.reset();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
window.addEventListener("beforeunload", function (ev) {
|
||||||
|
if (isEdited(form)) {
|
||||||
|
ev.preventDefault();
|
||||||
|
return ev.returnValue = "Discard changes?";
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
document
|
document
|
||||||
|
|
Loading…
Reference in a new issue