major change
This commit is contained in:
@@ -34,6 +34,37 @@
|
||||
t.classList.add('show');
|
||||
setTimeout(() => t.classList.remove('show'), 3000);
|
||||
}
|
||||
|
||||
// User dropdown
|
||||
function toggleUserDropdown() {
|
||||
const menu = document.getElementById('user-dropdown-menu');
|
||||
menu.classList.toggle('open');
|
||||
}
|
||||
function closeUserDropdown() {
|
||||
const menu = document.getElementById('user-dropdown-menu');
|
||||
if(menu) menu.classList.remove('open');
|
||||
}
|
||||
document.addEventListener('click', (e) => {
|
||||
const wrap = document.getElementById('user-dropdown-wrap');
|
||||
if (wrap && !wrap.contains(e.target)) closeUserDropdown();
|
||||
});
|
||||
|
||||
// Close modals on overlay click
|
||||
document.querySelectorAll('.modal-overlay').forEach(mo => {
|
||||
mo.addEventListener('click', (e) => {
|
||||
if (e.target === mo) mo.classList.remove('active');
|
||||
});
|
||||
});
|
||||
|
||||
// Auto open change-pw modal if there was a pw msg
|
||||
<?php
|
||||
$pw_msg_bottom = $_SESSION['pw_change_msg_bottom'] ?? null;
|
||||
if($pw_msg_bottom):
|
||||
?>
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
document.getElementById('change-pw-modal').classList.add('active');
|
||||
});
|
||||
<?php endif; ?>
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user