tweaks to similar notes + missing options init

This commit is contained in:
zadam 2019-09-01 11:37:43 +02:00
parent 55356963dd
commit c8a5c71ec2
3 changed files with 8 additions and 4 deletions

View File

@ -1,2 +1,2 @@
INSERT INTO options (name, value, utcDateCreated, utcDateModified, isSynced)
VALUES ('similarNotesWidget', '{"enabled":false,"expanded":true,"position":60}', '2018-07-29T18:31:00.874Z', '2018-07-29T18:31:00.874Z', 0);
VALUES ('similarNotesWidget', '{"enabled":true,"expanded":true,"position":60}', '2018-07-29T18:31:00.874Z', '2018-07-29T18:31:00.874Z', 0);

View File

@ -22,11 +22,14 @@ class SimilarNotesWidget extends StandardWidget {
const $list = $('<ul style="padding-left: 20px;">');
for (const similarNote of similarNotes) {
const $item = $("<li>")
.append(await linkService.createNoteLink(similarNote.notePath.join("/")));
similarNote.notePath.pop(); // remove last noteId since it's already in the link
const $item = $("<li>")
.append(await linkService.createNoteLink(similarNote.noteId))
.append($("<small>").text(" (" + await treeUtils.getNotePathTitle(similarNote.notePath.join("/")) + ")"));
if (similarNote.notePath.length > 0) {
$item.append($("<small>").text(" (" + await treeUtils.getNotePathTitle(similarNote.notePath.join("/")) + ")"));
}
$list.append($item);
}

View File

@ -74,6 +74,7 @@ async function initNotSyncedOptions(initialized, startNotePath = 'root', opts =
await optionService.createOption('linkMapWidget', '{"enabled":true,"expanded":true,"position":30}', false);
await optionService.createOption('noteRevisionsWidget', '{"enabled":true,"expanded":true,"position":40}', false);
await optionService.createOption('whatLinksHereWidget', '{"enabled":false,"expanded":true,"position":50}', false);
await optionService.createOption('similarNotesWidget', '{"enabled":true,"expanded":true,"position":60}', false);
await optionService.createOption('initialized', initialized ? 'true' : 'false', false);
}