recent notes are now keyed by note tree id which simplifies things

This commit is contained in:
azivner
2017-12-03 10:06:53 -05:00
parent 41f089b3f4
commit 15faefe8a3
10 changed files with 36 additions and 54 deletions

View File

@@ -319,10 +319,11 @@ const noteTree = (function() {
function setCurrentNotePathToHash(node) {
const currentNotePath = treeUtils.getNotePath(node);
const currentNoteTreeId = node.data.note_tree_id;
document.location.hash = currentNotePath;
recentNotes.addRecentNote(currentNotePath);
recentNotes.addRecentNote(currentNoteTreeId, currentNotePath);
}
function initFancyTree(noteTree) {
@@ -343,13 +344,13 @@ const noteTree = (function() {
const beforeNode = node.getPrevSibling();
if (beforeNode !== null) {
treeChanges.moveBeforeNode(node, beforeNode, false);
treeChanges.moveBeforeNode(node, beforeNode);
}
},
"shift+down": node => {
let afterNode = node.getNextSibling();
if (afterNode !== null) {
treeChanges.moveAfterNode(node, afterNode, false);
treeChanges.moveAfterNode(node, afterNode);
}
},
"shift+left": node => {
@@ -625,6 +626,6 @@ const noteTree = (function() {
createNewTopLevelNote,
createNote,
setPrefix,
getNotePathTitle
};
})();