Fix admin modal auto-opening on page load

- Removed conflicting display: flex from .modal CSS rule
- Added .modal.show class for proper centering when opened
- Updated JavaScript to use classList.add/remove instead of direct style.display
parent 381ddcc4
...@@ -30,7 +30,8 @@ ...@@ -30,7 +30,8 @@
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; } .alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
/* Modal Styles */ /* Modal Styles */
.modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; } .modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.5); }
.modal.show { display: flex; align-items: center; justify-content: center; }
.modal-content { background-color: white; margin: 0; padding: 0; width: 90%; max-width: 600px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.3); max-height: 90vh; overflow: hidden; display: flex; flex-direction: column; } .modal-content { background-color: white; margin: 0; padding: 0; width: 90%; max-width: 600px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.3); max-height: 90vh; overflow: hidden; display: flex; flex-direction: column; }
.modal-header { padding: 1rem 2rem; border-bottom: 1px solid #e5e7eb; display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; } .modal-header { padding: 1rem 2rem; border-bottom: 1px solid #e5e7eb; display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; }
.modal-body { padding: 2rem; overflow-y: auto; flex: 1; } .modal-body { padding: 2rem; overflow-y: auto; flex: 1; }
...@@ -227,12 +228,12 @@ ...@@ -227,12 +228,12 @@
document.getElementById('editTokens').value = tokens; document.getElementById('editTokens').value = tokens;
document.getElementById('editPassword').value = ''; document.getElementById('editPassword').value = '';
document.getElementById('editUserForm').action = `/admin/users/${id}/update`; document.getElementById('editUserForm').action = `/admin/users/${id}/update`;
document.getElementById('editUserModal').style.display = 'flex'; document.getElementById('editUserModal').classList.add('show');
document.body.style.overflow = 'hidden'; document.body.style.overflow = 'hidden';
} }
function closeEditModal() { function closeEditModal() {
document.getElementById('editUserModal').style.display = 'none'; document.getElementById('editUserModal').classList.remove('show');
document.body.style.overflow = 'auto'; document.body.style.overflow = 'auto';
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment