button for creating subnote in relation map and other unrelated changed, WIP

This commit is contained in:
azivner
2018-10-31 12:29:01 +01:00
parent 639284fd85
commit 4858f0bec6
9 changed files with 87 additions and 14 deletions

View File

@@ -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;