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

@@ -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);

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
};

View File

@@ -34,7 +34,7 @@ class NoteDetailSearch {
this.$searchString.val('');
}
this.$searchString.on('input', noteDetailService.noteChanged);
this.$searchString.on('input', () => this.ctx.noteChanged());
}
getContent() {

View File

@@ -30,7 +30,7 @@
<strong>max notes:</strong>
</label>
<input id="link-map-max-notes" type="number" value="50" min="5" max="1000" step="10"
<input id="link-map-max-notes" type="number" value="50" min="5" max="1000" step="5"
class="form-control form-control-sm"
style="width: 80px; display: inline-block; text-align: right;"/>
</div>