fixes for "add child note" button

This commit is contained in:
azivner 2018-10-31 18:21:58 +01:00
parent 5cc91c64a3
commit ab26216cbe
3 changed files with 9 additions and 3 deletions

View File

@ -402,11 +402,15 @@ $createChildNote.click(async () => {
target: 'into' target: 'into'
}); });
// reloading tree so that the new note appears there
// no need to wait for it to finish
treeService.reload();
const [x, y] = getFreePosition(); const [x, y] = getFreePosition();
mapData.notes.push({ id: note.noteId, x, y }); mapData.notes.push({ id: note.noteId, x, y });
await createNoteBox(id, title, x, y); await createNoteBox(note.noteId, title, x, y);
}); });
export default { export default {

View File

@ -482,13 +482,13 @@ async function createNote(node, parentNoteId, target, isProtected, saveSelection
await noteDetailService.saveNoteIfChanged(); await noteDetailService.saveNoteIfChanged();
noteDetailService.newNoteCreated();
const noteEntity = new NoteShort(treeCache, note); const noteEntity = new NoteShort(treeCache, note);
const branchEntity = new Branch(treeCache, branch); const branchEntity = new Branch(treeCache, branch);
treeCache.add(noteEntity, branchEntity); treeCache.add(noteEntity, branchEntity);
noteDetailService.newNoteCreated();
const newNode = { const newNode = {
title: newNoteName, title: newNoteName,
noteId: branchEntity.noteId, noteId: branchEntity.noteId,

View File

@ -266,6 +266,8 @@
<button id="relation-map-add-child-notes" class="btn" type="button" <button id="relation-map-add-child-notes" class="btn" type="button"
title="Add all child notes of this relation map note">Add child notes</button> title="Add all child notes of this relation map note">Add child notes</button>
&nbsp;
<button id="relation-map-create-child-note" class="btn" type="button" <button id="relation-map-create-child-note" class="btn" type="button"
title="Create new child note and add it into this relation map">Create child note</button> title="Create new child note and add it into this relation map">Create child note</button>