allow specifiyng sorted attribute (including off for overriding), #2142

This commit is contained in:
zadam
2021-09-03 22:33:40 +02:00
parent 6e300c7cf5
commit 5cfd1c030d
7 changed files with 58 additions and 73 deletions

View File

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