update menu bar active nav path detection
This commit is contained in:
1 parent
ffa60e8cc5
commit
191d03c141
1 file changed
+2
-5
@@ -66,11 +66,6 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
updateActiveNavPath();
|
|
||||||
// the mutation observer callback runs too fast, hence the call to `updateActiveNavPath` must be wrapped in an empty
|
|
||||||
// setTimeout to not cause any visual bugs
|
|
||||||
new MutationObserver(() => setTimeout(updateActiveNavPath)).observe(document.head, { childList: true });
|
|
||||||
|
|
||||||
document.addEventListener('astro:page-load', () => {
|
document.addEventListener('astro:page-load', () => {
|
||||||
pageLoadTimestamp = Date.now();
|
pageLoadTimestamp = Date.now();
|
||||||
|
|
||||||
@@ -88,6 +83,8 @@
|
|||||||
|
|
||||||
document.body.addEventListener('touchstart', touchStartListener);
|
document.body.addEventListener('touchstart', touchStartListener);
|
||||||
document.body.addEventListener('touchend', touchEndListener);
|
document.body.addEventListener('touchend', touchEndListener);
|
||||||
|
|
||||||
|
updateActiveNavPath();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user