Skip to content

Commit 6187475

Browse files
committed
Update blink.
1 parent 00e1278 commit 6187475

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/pages/schedule.astro

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ const days = await getCollection("days");
2727
))
2828
}
2929
</Layout>
30-
<script is:inline data-astro-rerun>
30+
<script>
31+
window.addEventListener('load', function() {
3132
function checkForAnchorAndHighlight() {
3233
const currentAnchor = window.location.hash.substring(1);
3334

@@ -37,7 +38,7 @@ const days = await getCollection("days");
3738
const targetH2 = allMatching[allMatching.length - 1];
3839

3940
if (targetH2) {
40-
const parentElement = targetH2.parentElement;
41+
const parentElement: any = targetH2.parentElement;
4142

4243
if (parentElement) {
4344
const originalBorder = parentElement.style.border;
@@ -85,4 +86,6 @@ const days = await getCollection("days");
8586
checkForAnchorAndHighlight();
8687

8788
window.addEventListener('hashchange', checkForAnchorAndHighlight);
89+
document.addEventListener('astro:after-swap', checkForAnchorAndHighlight);
90+
});
8891
</script>

0 commit comments

Comments
 (0)