mirror of
https://github.com/zadam/trilium.git
synced 2025-10-27 16:26:31 +01:00
recent notes are now keyed by note tree id which simplifies things
This commit is contained in:
@@ -1,28 +1,20 @@
|
||||
"use strict";
|
||||
|
||||
const treeChanges = (function() {
|
||||
async function moveBeforeNode(node, beforeNode, changeInPath = true) {
|
||||
async function moveBeforeNode(node, beforeNode) {
|
||||
await server.put('notes/' + node.data.note_tree_id + '/move-before/' + beforeNode.data.note_tree_id);
|
||||
|
||||
node.moveTo(beforeNode, 'before');
|
||||
|
||||
if (changeInPath) {
|
||||
recentNotes.removeRecentNote(noteTree.getCurrentNotePath());
|
||||
|
||||
noteTree.setCurrentNotePathToHash(node);
|
||||
}
|
||||
noteTree.setCurrentNotePathToHash(node);
|
||||
}
|
||||
|
||||
async function moveAfterNode(node, afterNode, changeInPath = true) {
|
||||
async function moveAfterNode(node, afterNode) {
|
||||
await server.put('notes/' + node.data.note_tree_id + '/move-after/' + afterNode.data.note_tree_id);
|
||||
|
||||
node.moveTo(afterNode, 'after');
|
||||
|
||||
if (changeInPath) {
|
||||
recentNotes.removeRecentNote(noteTree.getCurrentNotePath());
|
||||
|
||||
noteTree.setCurrentNotePathToHash(node);
|
||||
}
|
||||
noteTree.setCurrentNotePathToHash(node);
|
||||
}
|
||||
|
||||
// beware that first arg is noteId and second is noteTreeId!
|
||||
@@ -47,8 +39,6 @@ const treeChanges = (function() {
|
||||
toNode.folder = true;
|
||||
toNode.renderTitle();
|
||||
|
||||
recentNotes.removeRecentNote(noteTree.getCurrentNotePath());
|
||||
|
||||
noteTree.setCurrentNotePathToHash(node);
|
||||
}
|
||||
|
||||
@@ -75,8 +65,6 @@ const treeChanges = (function() {
|
||||
node.getParent().renderTitle();
|
||||
}
|
||||
|
||||
recentNotes.removeRecentNote(noteTree.getCurrentNotePath());
|
||||
|
||||
let next = node.getNextSibling();
|
||||
if (!next) {
|
||||
next = node.getParent();
|
||||
|
||||
Reference in New Issue
Block a user