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,13 +132,15 @@ const publicDemoSite = isEnabled((globalThis as any).process?.env?.PUBLIC_DEMO_S
|
||||||
setNavOpen(!nav.classList.contains('is-open'));
|
setNavOpen(!nav.classList.contains('is-open'));
|
||||||
});
|
});
|
||||||
|
|
||||||
nav.querySelectorAll('a').forEach((link) => {
|
nav.addEventListener('click', (event) => {
|
||||||
link.addEventListener('click', () => {
|
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) {
|
if (window.matchMedia('(max-width: 640px)').matches) {
|
||||||
setNavOpen(false);
|
setNavOpen(false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
|
||||||
|
|
||||||
window.addEventListener('resize', () => {
|
window.addEventListener('resize', () => {
|
||||||
if (window.innerWidth > 640) {
|
if (window.innerWidth > 640) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue