mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
after note creation with becca
This commit is contained in:
parent
6c5b1420d2
commit
a5ee590544
@ -145,7 +145,7 @@ function createNewNote(params) {
|
|||||||
|
|
||||||
function createNewNoteWithTarget(target, targetBranchId, params) {
|
function createNewNoteWithTarget(target, targetBranchId, params) {
|
||||||
if (!params.type) {
|
if (!params.type) {
|
||||||
const parentNote = repository.getNote(params.parentNoteId);
|
const parentNote = becca.notes[params.parentNoteId];
|
||||||
|
|
||||||
// code note type can be inherited, otherwise text is default
|
// code note type can be inherited, otherwise text is default
|
||||||
params.type = parentNote.type === 'code' ? 'code' : 'text';
|
params.type = parentNote.type === 'code' ? 'code' : 'text';
|
||||||
@ -156,13 +156,13 @@ function createNewNoteWithTarget(target, targetBranchId, params) {
|
|||||||
return createNewNote(params);
|
return createNewNote(params);
|
||||||
}
|
}
|
||||||
else if (target === 'after') {
|
else if (target === 'after') {
|
||||||
const afterNote = becca.branches[targetBranchId].notePosition;
|
const afterBranch = becca.branches[targetBranchId];
|
||||||
|
|
||||||
// not updating utcDateModified to avoig having to sync whole rows
|
// not updating utcDateModified to avoid having to sync whole rows
|
||||||
sql.execute('UPDATE branches SET notePosition = notePosition + 10 WHERE parentNoteId = ? AND notePosition > ? AND isDeleted = 0',
|
sql.execute('UPDATE branches SET notePosition = notePosition + 10 WHERE parentNoteId = ? AND notePosition > ? AND isDeleted = 0',
|
||||||
[params.parentNoteId, afterNote.notePosition]);
|
[params.parentNoteId, afterBranch.notePosition]);
|
||||||
|
|
||||||
params.notePosition = afterNote.notePosition + 10;
|
params.notePosition = afterBranch.notePosition + 10;
|
||||||
|
|
||||||
const retObject = createNewNote(params);
|
const retObject = createNewNote(params);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user