export stores note position and some other fixes

This commit is contained in:
azivner
2018-11-26 23:39:43 +01:00
parent 137b9dfa0b
commit 139c99440f
3 changed files with 37 additions and 7 deletions

View File

@@ -49,7 +49,14 @@ async function triggerNoteTitleChanged(note) {
* FIXME: noteData has mandatory property "target", it might be better to add it as parameter to reflect this
*/
async function createNewNote(parentNoteId, noteData) {
const newNotePos = await getNewNotePosition(parentNoteId, noteData);
let newNotePos;
if (noteData.notePosition !== undefined) {
newNotePos = noteData.notePosition;
}
else {
newNotePos = await getNewNotePosition(parentNoteId, noteData);
}
const parentNote = await repository.getNote(parentNoteId);
@@ -130,7 +137,8 @@ async function createNote(parentNoteId, title, content = "", extraOptions = {})
type: extraOptions.type,
mime: extraOptions.mime,
dateCreated: extraOptions.dateCreated,
isExpanded: extraOptions.isExpanded
isExpanded: extraOptions.isExpanded,
notePosition: extraOptions.notePosition
};
if (extraOptions.json && !noteData.type) {