mirror of
https://github.com/zadam/trilium.git
synced 2025-06-04 08:58:40 +02:00
make sure the sorted branches are still sorted after drag & drop, #2142
This commit is contained in:
parent
167d4816fd
commit
6e300c7cf5
Binary file not shown.
6
package-lock.json
generated
6
package-lock.json
generated
@ -2890,9 +2890,9 @@
|
||||
}
|
||||
},
|
||||
"electron": {
|
||||
"version": "14.0.0",
|
||||
"resolved": "https://registry.npmjs.org/electron/-/electron-14.0.0.tgz",
|
||||
"integrity": "sha512-O6EI7L1BPIrTpEIFefjjmdbmSn9LtE4mmrv4dfpV4Mqaa8uKuNYQogwZPEvSwaBexb69eb1LQ25n+f+kBcjiRQ==",
|
||||
"version": "13.3.0",
|
||||
"resolved": "https://registry.npmjs.org/electron/-/electron-13.3.0.tgz",
|
||||
"integrity": "sha512-d/BvOLDjI4i7yf9tqCuLL2fFGA2TrM/D9PyRpua+rJolG0qrwp/FohP02L0m+44kmPpofIo4l3NPwLmzyKKimA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@electron/get": "^1.0.1",
|
||||
|
@ -81,7 +81,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"cross-env": "7.0.3",
|
||||
"electron": "14.0.0",
|
||||
"electron": "13.3.0",
|
||||
"electron-builder": "22.11.7",
|
||||
"electron-packager": "15.3.0",
|
||||
"electron-rebuild": "3.2.3",
|
||||
|
@ -85,8 +85,6 @@ function moveBranchBeforeNote(req) {
|
||||
}
|
||||
}
|
||||
|
||||
entityChangesService.addNoteReorderingEntityChange(beforeBranch.parentNoteId);
|
||||
|
||||
if (branchToMove.parentNoteId === beforeBranch.parentNoteId) {
|
||||
branchToMove.notePosition = originalBeforeNotePosition;
|
||||
branchToMove.save();
|
||||
@ -98,6 +96,13 @@ function moveBranchBeforeNote(req) {
|
||||
branchToMove.markAsDeleted();
|
||||
}
|
||||
|
||||
if (parentNote.hasLabel('sorted')) {
|
||||
treeService.sortNotesByTitle(parentNote.noteId, false, false);
|
||||
}
|
||||
else {
|
||||
entityChangesService.addNoteReorderingEntityChange(parentNote.noteId);
|
||||
}
|
||||
|
||||
return { success: true };
|
||||
}
|
||||
|
||||
@ -129,8 +134,6 @@ function moveBranchAfterNote(req) {
|
||||
}
|
||||
}
|
||||
|
||||
entityChangesService.addNoteReorderingEntityChange(afterNote.parentNoteId);
|
||||
|
||||
const movedNotePosition = originalAfterNotePosition + 10;
|
||||
|
||||
if (branchToMove.parentNoteId === afterNote.parentNoteId) {
|
||||
@ -144,6 +147,13 @@ function moveBranchAfterNote(req) {
|
||||
branchToMove.markAsDeleted();
|
||||
}
|
||||
|
||||
if (parentNote.hasLabel('sorted')) {
|
||||
treeService.sortNotesByTitle(parentNote.noteId, false, false);
|
||||
}
|
||||
else {
|
||||
entityChangesService.addNoteReorderingEntityChange(parentNote.noteId);
|
||||
}
|
||||
|
||||
return { success: true };
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user