Fix edit user modal scrolling issue

- Changed modal to use flexbox for proper centering
- Added max-height and overflow-y: auto to modal-body for scrollable content
- Prevented background page scrolling when modal is open
- Modal now stays within viewport and scrolls internally
parent 64101a68
...@@ -45,11 +45,11 @@ ...@@ -45,11 +45,11 @@
.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); } .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-content { background-color: white; margin: 5% auto; padding: 0; width: 90%; max-width: 600px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.3); } .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; } .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; } .modal-body { padding: 2rem; overflow-y: auto; flex: 1; }
.modal-footer { padding: 1rem 2rem; border-top: 1px solid #e5e7eb; text-align: right; } .modal-footer { padding: 1rem 2rem; border-top: 1px solid #e5e7eb; text-align: right; flex-shrink: 0; }
.form-row { display: flex; gap: 1rem; } .form-row { display: flex; gap: 1rem; }
.form-row .form-group { flex: 1; } .form-row .form-group { flex: 1; }
</style> </style>
...@@ -227,11 +227,13 @@ ...@@ -227,11 +227,13 @@
document.getElementById('editTokens').value = tokens; document.getElementById('editTokens').value = tokens;
document.getElementById('editPassword').value = ''; document.getElementById('editPassword').value = '';
document.getElementById('editUserForm').action = `/admin/user/${id}/update`; document.getElementById('editUserForm').action = `/admin/user/${id}/update`;
document.getElementById('editUserModal').style.display = 'block'; document.getElementById('editUserModal').style.display = 'flex';
document.body.style.overflow = 'hidden';
} }
function closeEditModal() { function closeEditModal() {
document.getElementById('editUserModal').style.display = 'none'; document.getElementById('editUserModal').style.display = 'none';
document.body.style.overflow = 'auto';
} }
function deleteUser(id, username) { function deleteUser(id, username) {
......
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