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
+1 -1
View File
@@ -32,7 +32,7 @@ async function showDialog() {
glob.activeDialog = $dialog;
// set default settings
$maxNotesInput.val(20);
$maxNotesInput.val(10);
LINK_TYPES.forEach(lt => $("#link-map-" + lt).prop('checked', true));
await libraryLoader.requireLibrary(libraryLoader.LINK_MAP);
+10 -1
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
};
@@ -34,7 +34,7 @@ class NoteDetailSearch {
this.$searchString.val('');
}
this.$searchString.on('input', noteDetailService.noteChanged);
this.$searchString.on('input', () => this.ctx.noteChanged());
}
getContent() {