Commit abc9295b authored by Janne Koschinski's avatar Janne Koschinski

Minor UI fix

parent df8b460b
......@@ -79,9 +79,11 @@ save.addEventListener("click", (e) => {
doSave();
});
window.onbeforeunload = () => {
window.addEventListener("beforeunload", (e) => {
const state = currentState();
if (lastSaved !== null && lastSaved !== state) {
return "Your changes have not been saved. Are you sure you want to leave?"
const message = "Your changes have not been saved. Are you sure you want to leave?";
e.returnValue = message;
return message;
}
};
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment