mirror of
https://codeberg.org/likwid/likwid.git
synced 2026-06-25 07:27:42 +00:00
frontend: modify 1 file
Verified changes: - modify frontend/src/layouts/Layout.astro Diffstat: - 1 file changed, 8 insertions(+), 6 deletions(-)
This commit is contained in:
parent
fea8a9a1d4
commit
31be888a7e
1 changed files with 8 additions and 6 deletions
|
|
@ -132,12 +132,14 @@ const publicDemoSite = isEnabled((globalThis as any).process?.env?.PUBLIC_DEMO_S
|
|||
setNavOpen(!nav.classList.contains('is-open'));
|
||||
});
|
||||
|
||||
nav.querySelectorAll('a').forEach((link) => {
|
||||
link.addEventListener('click', () => {
|
||||
if (window.matchMedia('(max-width: 640px)').matches) {
|
||||
setNavOpen(false);
|
||||
}
|
||||
});
|
||||
nav.addEventListener('click', (event) => {
|
||||
const target = event.target;
|
||||
if (!(target instanceof HTMLElement)) return;
|
||||
if (target.closest('#nav-toggle')) return;
|
||||
if (!target.closest('a')) return;
|
||||
if (window.matchMedia('(max-width: 640px)').matches) {
|
||||
setNavOpen(false);
|
||||
}
|
||||
});
|
||||
|
||||
window.addEventListener('resize', () => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue