|
|
@ -19,6 +19,8 @@ function bindEvents() { |
|
|
|
...target.closest('button')?.dataset, |
|
|
|
...target.closest('button')?.dataset, |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const accountDropdown = document.querySelector('[data-account-dropdown]'); |
|
|
|
|
|
|
|
|
|
|
|
// If the user clicks on the logout button, remove the token cookie
|
|
|
|
// If the user clicks on the logout button, remove the token cookie
|
|
|
|
if (dataset.logoutButton !== undefined) { |
|
|
|
if (dataset.logoutButton !== undefined) { |
|
|
|
e.preventDefault(); |
|
|
|
e.preventDefault(); |
|
|
@ -27,6 +29,12 @@ function bindEvents() { |
|
|
|
document.querySelector('[data-mobile-nav]')?.classList.remove('hidden'); |
|
|
|
document.querySelector('[data-mobile-nav]')?.classList.remove('hidden'); |
|
|
|
} else if (dataset.closeMobileNav !== undefined) { |
|
|
|
} else if (dataset.closeMobileNav !== undefined) { |
|
|
|
document.querySelector('[data-mobile-nav]')?.classList.add('hidden'); |
|
|
|
document.querySelector('[data-mobile-nav]')?.classList.add('hidden'); |
|
|
|
|
|
|
|
} else if ( |
|
|
|
|
|
|
|
accountDropdown && |
|
|
|
|
|
|
|
!target?.closest('[data-account-dropdown]') && |
|
|
|
|
|
|
|
!accountDropdown.classList.contains('hidden') |
|
|
|
|
|
|
|
) { |
|
|
|
|
|
|
|
accountDropdown.classList.add('hidden'); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|