mirror of
https://github.com/zadam/trilium.git
synced 2025-11-03 11:56:01 +01:00
add support for "bottom" sort, closes #4277
This commit is contained in:
@@ -126,6 +126,14 @@ function sortNotes(parentNoteId, customSortBy = 'title', reverse = false, folder
|
||||
return compare(topAEl, topBEl) * (reverse ? -1 : 1);
|
||||
}
|
||||
|
||||
const bottomAEl = fetchValue(a, 'bottom');
|
||||
const bottomBEl = fetchValue(b, 'bottom');
|
||||
|
||||
if (bottomAEl !== bottomBEl) {
|
||||
// since "bottom" should not be reversible, we'll reverse it once more to nullify this effect
|
||||
return compare(bottomBEl, bottomAEl) * (reverse ? -1 : 1);
|
||||
}
|
||||
|
||||
const customAEl = fetchValue(a, customSortBy);
|
||||
const customBEl = fetchValue(b, customSortBy);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user