mirror of
https://github.com/zadam/trilium.git
synced 2025-11-05 04:45:47 +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);
|
||||
|
||||
@@ -583,4 +583,12 @@ table.promoted-attributes-in-tooltip td, table.promoted-attributes-in-tooltip th
|
||||
color: orange;
|
||||
border: 0;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.modalless {
|
||||
top:10%;
|
||||
left:50%;
|
||||
bottom:auto;
|
||||
right:auto;
|
||||
margin-left:-300px;
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
<div id="protected-session-password-dialog" class="modal fade mx-auto" tabindex="-1" role="dialog">
|
||||
<div id="protected-session-password-dialog" class="modal mx-auto" data-backdrop="false" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
|
||||
@@ -210,7 +210,6 @@
|
||||
|
||||
<script src="/libraries/jquery.min.js"></script>
|
||||
|
||||
<!-- bootstrap needs to be included before jQuery UI, otherwise close icon in the dialog will be missing -->
|
||||
<link href="/libraries/bootstrap/css/bootstrap.min.css" rel="stylesheet">
|
||||
<script src="/libraries/bootstrap/js/bootstrap.bundle.min.js"></script>
|
||||
|
||||
@@ -227,8 +226,6 @@
|
||||
|
||||
<script src="/libraries/autocomplete.jquery.min.js"></script>
|
||||
|
||||
<script src="/libraries/feather.min.js"></script>
|
||||
|
||||
<link href="/stylesheets/style.css" rel="stylesheet">
|
||||
|
||||
<script src="/javascripts/services/bootstrap.js" type="module"></script>
|
||||
|
||||
Reference in New Issue
Block a user