return focus to the previously focused element after closing the dialog, fixes #861

This commit is contained in:
zadam
2020-02-09 10:00:13 +01:00
parent 990a84c202
commit 402718d293
26 changed files with 74 additions and 112 deletions

View File

@@ -16,8 +16,6 @@ const $explodeArchivesCheckbox = $("#explode-archives-checkbox");
let parentNoteId = null;
export async function showDialog(node) {
utils.closeActiveDialog();
$fileUploadInput.val('').trigger('change'); // to trigger Import button disabling listener below
$safeImportCheckbox.prop("checked", true);
@@ -26,13 +24,11 @@ export async function showDialog(node) {
$codeImportedAsCodeCheckbox.prop("checked", true);
$explodeArchivesCheckbox.prop("checked", true);
glob.activeDialog = $dialog;
parentNoteId = node.data.noteId;
$noteTitle.text(await treeUtils.getNoteTitle(parentNoteId));
$dialog.modal();
utils.openDialog($dialog);
}
$form.on('submit', () => {