mirror of
https://github.com/zadam/trilium.git
synced 2025-11-06 21:36:05 +01:00
add support for "bottom" sort, closes #4277
This commit is contained in:
@@ -171,8 +171,15 @@ function handleMaybeSortingLabel(entity) {
|
||||
if (note) {
|
||||
for (const parentNote of note.getParentNotes()) {
|
||||
const sorted = parentNote.getLabelValue("sorted");
|
||||
if (sorted === null) {
|
||||
// checking specifically for null since that means the label doesn't exist
|
||||
// empty valued "sorted" is still valid
|
||||
continue;
|
||||
}
|
||||
|
||||
if (sorted?.includes(entity.name)) { // hacky check if the sorting is affected by this label
|
||||
if (sorted.includes(entity.name) // hacky check if this label is used in the sort
|
||||
|| entity.name === "top"
|
||||
|| entity.name === "bottom") {
|
||||
treeService.sortNotesIfNeeded(parentNote.noteId);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user