cloning in context menu (copy & paste) and a lot of related refactoring and fixes

This commit is contained in:
azivner
2017-11-22 23:16:54 -05:00
parent c1fca4764b
commit acba72ec4c
12 changed files with 260 additions and 188 deletions

View File

@@ -18,7 +18,7 @@ async function createNewNote(parentNoteId, note, browserId) {
newNotePos = maxNotePos === null ? 0 : maxNotePos + 1;
}
else if (note.target === 'after') {
const afterNote = await sql.getSingleResult('SELECT note_pos FROM notes_tree WHERE note_id = ?', [note.target_note_id]);
const afterNote = await sql.getSingleResult('SELECT note_pos FROM notes_tree WHERE note_tree_id = ?', [note.target_note_tree_id]);
newNotePos = afterNote.note_pos + 1;