From f3ed7e936deffa157265295c81615101552d854c Mon Sep 17 00:00:00 2001 From: zadam Date: Thu, 6 Jun 2019 21:16:12 +0200 Subject: [PATCH] focus input on shown modal in branch prefix dialog, fixes #560 --- package-lock.json | 2 +- src/public/javascripts/dialogs/branch_prefix.js | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8688a2172..d02cd1624 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "trilium", - "version": "0.32.2-beta", + "version": "0.32.4", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/src/public/javascripts/dialogs/branch_prefix.js b/src/public/javascripts/dialogs/branch_prefix.js index ef8f77b57..152a3c526 100644 --- a/src/public/javascripts/dialogs/branch_prefix.js +++ b/src/public/javascripts/dialogs/branch_prefix.js @@ -21,7 +21,7 @@ async function showDialog() { branchId = currentNode.data.branchId; const branch = await treeCache.getBranch(branchId); - $treePrefixInput.val(branch.prefix).focus(); + $treePrefixInput.val(branch.prefix); const noteTitle = await treeUtils.getNoteTitle(currentNode.data.noteId); @@ -46,6 +46,8 @@ $form.submit(() => { return false; }); +$dialog.on('shown.bs.modal', () => $treePrefixInput.focus()); + export default { showDialog }; \ No newline at end of file