mirror of
https://github.com/zadam/trilium.git
synced 2025-11-03 20:06:08 +01:00
Merge branch 'stable' into next61
# Conflicts: # src/etapi/etapi.openapi.yaml # src/etapi/notes.js # src/public/app/widgets/type_widgets/editable_text.js # src/services/app_info.js
This commit is contained in:
@@ -27,11 +27,13 @@ const ws = require("./ws");
|
||||
function getNewNotePosition(parentNote) {
|
||||
if (parentNote.isLabelTruthy('newNotesOnTop')) {
|
||||
const minNotePos = parentNote.getChildBranches()
|
||||
.filter(branch => branch.noteId !== '_hidden') // has "always last" note position
|
||||
.reduce((min, note) => Math.min(min, note.notePosition), 0);
|
||||
|
||||
return minNotePos - 10;
|
||||
} else {
|
||||
const maxNotePos = parentNote.getChildBranches()
|
||||
.filter(branch => branch.noteId !== '_hidden') // has "always last" note position
|
||||
.reduce((max, note) => Math.max(max, note.notePosition), 0);
|
||||
|
||||
return maxNotePos + 10;
|
||||
|
||||
Reference in New Issue
Block a user