From 550811adfd1956384c5a8656124134fa4ce22878 Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Wed, 11 Oct 2017 22:55:45 -0400 Subject: [PATCH] Add a cruddy handler for prompt when unload "unsaved changes" thing --- js/editor.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/js/editor.js b/js/editor.js index 7bb0e46..9d98679 100644 --- a/js/editor.js +++ b/js/editor.js @@ -82,6 +82,9 @@ window.addEventListener("load", () => { reader.readAsDataURL(files[0]); } }); + + window.addEventListener('beforeunload', + e => e.returnValue = "Unsaved changes blah blah"); }); function downloadFile(file, name) {