mirror of
https://github.com/zadam/trilium.git
synced 2025-11-12 08:15:52 +01:00
allow specifiyng sorted attribute (including off for overriding), #2142
This commit is contained in:
@@ -96,12 +96,10 @@ function moveBranchBeforeNote(req) {
|
||||
branchToMove.markAsDeleted();
|
||||
}
|
||||
|
||||
if (parentNote.hasLabel('sorted')) {
|
||||
treeService.sortNotesByTitle(parentNote.noteId, false, false);
|
||||
}
|
||||
else {
|
||||
entityChangesService.addNoteReorderingEntityChange(parentNote.noteId);
|
||||
}
|
||||
treeService.sortNotesIfNeeded(parentNote.noteId);
|
||||
|
||||
// if sorting is not needed then still the ordering might have changed above manually
|
||||
entityChangesService.addNoteReorderingEntityChange(parentNote.noteId);
|
||||
|
||||
return { success: true };
|
||||
}
|
||||
@@ -147,12 +145,10 @@ function moveBranchAfterNote(req) {
|
||||
branchToMove.markAsDeleted();
|
||||
}
|
||||
|
||||
if (parentNote.hasLabel('sorted')) {
|
||||
treeService.sortNotesByTitle(parentNote.noteId, false, false);
|
||||
}
|
||||
else {
|
||||
entityChangesService.addNoteReorderingEntityChange(parentNote.noteId);
|
||||
}
|
||||
treeService.sortNotesIfNeeded(parentNote.noteId);
|
||||
|
||||
// if sorting is not needed then still the ordering might have changed above manually
|
||||
entityChangesService.addNoteReorderingEntityChange(parentNote.noteId);
|
||||
|
||||
return { success: true };
|
||||
}
|
||||
|
||||
@@ -97,12 +97,7 @@ function sortChildNotes(req) {
|
||||
|
||||
const reverse = sortDirection === 'desc';
|
||||
|
||||
if (sortBy === 'title') {
|
||||
treeService.sortNotesByTitle(noteId, false, reverse);
|
||||
}
|
||||
else {
|
||||
treeService.sortNotes(noteId, sortBy, reverse);
|
||||
}
|
||||
treeService.sortNotes(noteId, sortBy, reverse);
|
||||
}
|
||||
|
||||
function protectNote(req) {
|
||||
|
||||
Reference in New Issue
Block a user