fix note export/import/branch prefix to use right-clicked note as opposed to current active

This commit is contained in:
zadam
2019-06-20 09:37:18 +02:00
parent a7cf3cdf05
commit fead3cd7ad
9 changed files with 74 additions and 108 deletions

View File

@@ -12,21 +12,19 @@ const $noteTitle = $('#branch-prefix-note-title');
let branchId;
async function showDialog() {
async function showDialog(node) {
utils.closeActiveDialog();
glob.activeDialog = $dialog;
$dialog.modal();
const currentNode = treeService.getActiveNode();
branchId = currentNode.data.branchId;
branchId = node.data.branchId;
const branch = await treeCache.getBranch(branchId);
$treePrefixInput.val(branch.prefix);
const noteTitle = await treeUtils.getNoteTitle(currentNode.data.noteId);
const noteTitle = await treeUtils.getNoteTitle(node.data.noteId);
$noteTitle.text(" - " + noteTitle);
}