Skip to content

Commit

Permalink
Add unsaved popup alert
Browse files Browse the repository at this point in the history
  • Loading branch information
aiden2480 committed Mar 7, 2022
1 parent 52a80e1 commit c3f1666
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions js/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,3 +208,9 @@ document.getElementById("createset").addEventListener("click", async () => {
alert(err);
});
});

window.addEventListener("beforeunload", event => {
if (document.querySelector("[contentEditable=true]") !== null) {
return event.returnValue = "Are you sure you want to exit? You have unsaved changes";
}
});

0 comments on commit c3f1666

Please sign in to comment.