You've already forked AstralRinth
forked from didirus/AstralRinth
Fix noScroll & add prefetch to NavRow
This commit is contained in:
@@ -13,7 +13,7 @@
|
|||||||
/** Query param name to use (to not use queries, leave this prop blank) */
|
/** Query param name to use (to not use queries, leave this prop blank) */
|
||||||
export let query = ''
|
export let query = ''
|
||||||
|
|
||||||
export let resetScroll = false
|
export let noScroll: true | null = null
|
||||||
|
|
||||||
/** Path level in URL, zero-indexed */
|
/** Path level in URL, zero-indexed */
|
||||||
export let level = 0
|
export let level = 0
|
||||||
@@ -96,12 +96,10 @@
|
|||||||
: level === 0
|
: level === 0
|
||||||
? link.href
|
? link.href
|
||||||
: basePath + link.href}
|
: basePath + link.href}
|
||||||
on:click={() => {
|
|
||||||
if (resetScroll) document.body.scrollTo(0, 0)
|
|
||||||
}}
|
|
||||||
class="navigation__link"
|
class="navigation__link"
|
||||||
class:is-active={index === activeIndex}
|
class:is-active={index === activeIndex}
|
||||||
sveltekit:noscroll={!resetScroll || null}
|
sveltekit:noscroll={noScroll}
|
||||||
|
sveltekit:prefetch
|
||||||
bind:this={linkElements[index]}>
|
bind:this={linkElements[index]}>
|
||||||
{link.label}
|
{link.label}
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
Reference in New Issue
Block a user