small fixes

This commit is contained in:
zadam
2019-06-12 19:59:52 +02:00
parent f2c497049b
commit c8049f0efe
6 changed files with 103 additions and 331 deletions

View File

@@ -508,6 +508,14 @@ async function saveOpenTabs() {
});
}
function noteChanged() {
const activeTabContext = getActiveTabContext();
if (activeTabContext) {
activeTabContext.noteChanged();
}
}
// 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', () => { saveNotesIfChanged(); }); // don't convert to short form, handler doesn't like returned promise
@@ -537,5 +545,6 @@ export default {
filterTabs,
openEmptyTab,
noteDeleted,
refreshTabs
refreshTabs,
noteChanged
};