mirror of
https://github.com/zadam/trilium.git
synced 2025-11-02 19:36:12 +01:00
enter protected password is not modal now, closes #217
This commit is contained in:
@@ -40,6 +40,7 @@ function ensureProtectedSession(requireProtectedSession, modal) {
|
||||
$noteDetailWrapper.hide();
|
||||
}
|
||||
|
||||
$dialog.toggleClass("modalless", !modal);
|
||||
$dialog.modal();
|
||||
}
|
||||
else {
|
||||
@@ -156,7 +157,16 @@ $passwordForm.submit(() => {
|
||||
return false;
|
||||
});
|
||||
|
||||
$dialog.on("shown.bs.modal", e => $password.focus());
|
||||
// this doesn't work, event is not triggered :/
|
||||
$dialog.on("show.bs.modal", e => function() {
|
||||
if ($(this).hasClass("modalless")) {
|
||||
// return "stolen" focus to tree
|
||||
treeService.getCurrentNode().setFocus();
|
||||
}
|
||||
else {
|
||||
$password.focus();
|
||||
}
|
||||
});
|
||||
|
||||
$protectButton.click(protectNoteAndSendToServer);
|
||||
$unprotectButton.click(unprotectNoteAndSendToServer);
|
||||
|
||||
Reference in New Issue
Block a user