diff --git a/static/css/style.css b/static/css/style.css index bf445dd0..674dc995 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -2489,6 +2489,11 @@ select:focus { animation: modalFadeIn 0.2s ease; } +.confirm-dialog.active { + display: flex; + opacity: 1; +} + .confirm-dialog-content { background: white; border-radius: 16px; diff --git a/static/js/contextMenus.js b/static/js/contextMenus.js index e8e64fe5..9d5f4fed 100644 --- a/static/js/contextMenus.js +++ b/static/js/contextMenus.js @@ -70,13 +70,11 @@ const contextMenus = { }); document.getElementById('delete-folder-option').addEventListener('click', async () => { - if (window.app.contextMenuTargetFolder) { - await window.fileOps.deleteFolder( - window.app.contextMenuTargetFolder.id, - window.app.contextMenuTargetFolder.name - ); - } + const folder = window.app.contextMenuTargetFolder; window.ui.closeContextMenu(); + if (folder) { + await window.fileOps.deleteFolder(folder.id, folder.name); + } }); // File context menu options @@ -174,13 +172,11 @@ const contextMenus = { }); document.getElementById('delete-file-option').addEventListener('click', async () => { - if (window.app.contextMenuTargetFile) { - await window.fileOps.deleteFile( - window.app.contextMenuTargetFile.id, - window.app.contextMenuTargetFile.name - ); - } + const file = window.app.contextMenuTargetFile; window.ui.closeFileContextMenu(); + if (file) { + await window.fileOps.deleteFile(file.id, file.name); + } }); // Rename dialog events