mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
distinction when user asks for action (encryption -> modal) and system asks for password (viewing - non-modal)
This commit is contained in:
parent
a024978d7b
commit
d41c9349b8
@ -156,13 +156,16 @@ function setNoteBackgroundIfEncrypted(note) {
|
||||
|
||||
let globalEncryptionCallback = null;
|
||||
|
||||
function handleEncryption(requireEncryption, callback) {
|
||||
function handleEncryption(requireEncryption, modal, callback) {
|
||||
if (requireEncryption && globalEncryptionKey === null) {
|
||||
globalEncryptionCallback = callback;
|
||||
|
||||
$("#noteDetailWrapper").hide();
|
||||
if (!modal) {
|
||||
$("#noteDetailWrapper").hide();
|
||||
}
|
||||
|
||||
$("#encryptionPasswordDialog").dialog({
|
||||
modal: false,
|
||||
modal: modal,
|
||||
width: 400
|
||||
});
|
||||
}
|
||||
@ -183,7 +186,7 @@ function loadNote(noteId) {
|
||||
$("#noteTitle").focus().select();
|
||||
}
|
||||
|
||||
handleEncryption(note.detail.encryption > 0, () => {
|
||||
handleEncryption(note.detail.encryption > 0, false, () => {
|
||||
$("#noteDetailWrapper").show();
|
||||
try {
|
||||
$("#encryptionPasswordDialog").dialog('close');
|
||||
@ -331,7 +334,7 @@ function encryptNote(note) {
|
||||
}
|
||||
|
||||
function encryptNoteAndSendToServer() {
|
||||
handleEncryption(true, () => {
|
||||
handleEncryption(true, true, () => {
|
||||
const note = globalNote;
|
||||
|
||||
updateNoteFromInputs(note);
|
||||
@ -347,7 +350,7 @@ function encryptNoteAndSendToServer() {
|
||||
}
|
||||
|
||||
function decryptNoteAndSendToServer() {
|
||||
handleEncryption(true, () => {
|
||||
handleEncryption(true, true, () => {
|
||||
const note = globalNote;
|
||||
|
||||
updateNoteFromInputs(note);
|
||||
|
Loading…
x
Reference in New Issue
Block a user