Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
handling of beforeunload - we save the note before unloading the page
azivneraf33a30ad897
diff --git a/static/js/init.js b/static/js/init.jsindex 812c0d943f..d9821b90b4 100644--- a/static/js/init.js+++ b/static/js/init.js@@ -231,4 +231,9 @@ $("#jumpToNoteForm").submit(function() {}return false;+});++$(window).on('beforeunload', function(){+ // asynchronously send the request and don't wait for result+ saveNoteIfChanged();});\ No newline at end of filediff --git a/static/js/note.js b/static/js/note.jsindex 19052f2c5c..70562d393e 100644--- a/static/js/note.js+++ b/static/js/note.js@@ -212,5 +212,5 @@ function encryptNote() {// To print or store the binary data, you may convert it to hexlet encryptedHex = aesjs.utils.hex.fromBytes(encryptedBytes);- console.log("encrypted: " + encryptedBytes);+ console.log("encrypted: " + encryptedHex);}\ No newline at end of file