From 9bb188b519f40276039ce66689b9d9668dfd65ff Mon Sep 17 00:00:00 2001 From: azivner Date: Tue, 27 Mar 2018 22:27:46 -0400 Subject: [PATCH] fix unnecessary popups about leaving the page --- src/public/javascripts/services/note_detail.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/public/javascripts/services/note_detail.js b/src/public/javascripts/services/note_detail.js index c8725880b..76141bd71 100644 --- a/src/public/javascripts/services/note_detail.js +++ b/src/public/javascripts/services/note_detail.js @@ -234,7 +234,7 @@ $(document).ready(() => { // this makes sure that when user e.g. reloads the page or navigates away from the page, the note's content is saved // this sends the request asynchronously and doesn't wait for result -$(window).on('beforeunload', saveNoteIfChanged); +$(window).on('beforeunload', () => { saveNoteIfChanged(); }); // don't convert to short form, handler doesn't like returned promise setInterval(saveNoteIfChanged, 5000);