Fix beforeunload not working

This commit is contained in:
Pavel Djundik 2019-12-18 11:28:39 +02:00
parent 86341f063c
commit 03d5fab794
1 changed files with 4 additions and 4 deletions

View File

@ -26,9 +26,9 @@ socket.once("configuration", function(data) {
}
if (document.body.classList.contains("public")) {
window.addEventListener(
"beforeunload",
() => "Are you sure you want to navigate away from this page?"
);
window.addEventListener("beforeunload", (e) => {
e.preventDefault();
e.returnValue = "Are you sure you want to navigate away from this page?";
});
}
});