mirror of
https://github.com/zadam/trilium.git
synced 2025-10-28 16:56:34 +01:00
button for creating subnote in relation map and other unrelated changed, WIP
This commit is contained in:
@@ -49,6 +49,18 @@ async function createNewNote(parentNoteId, noteData) {
|
||||
|
||||
const parentNote = await repository.getNote(parentNoteId);
|
||||
|
||||
if (!noteData.type) {
|
||||
if (parentNote.type === 'text' || parentNote.type === 'code') {
|
||||
noteData.type = parentNote.type;
|
||||
noteData.mime = parentNote.mime;
|
||||
}
|
||||
else {
|
||||
// inheriting note type makes sense only for text and code
|
||||
noteData.type = 'text';
|
||||
noteData.mime = 'text/html';
|
||||
}
|
||||
}
|
||||
|
||||
noteData.type = noteData.type || parentNote.type;
|
||||
noteData.mime = noteData.mime || parentNote.mime;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user