Use options parameters with types and default on smoothScroll function
This commit is contained in:
@@ -36,7 +36,7 @@
|
||||
size="xsmall"
|
||||
url="/shop/poster-{location.slug}"
|
||||
text="View"
|
||||
on:click={() => setTimeout(() => smoothScroll('poster', false), 1000)}
|
||||
on:click={() => setTimeout(() => smoothScroll({ hash: 'poster', changeHash: false }), 1000)}
|
||||
/>
|
||||
<Button
|
||||
tag="button"
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
const newPath = `/shop/poster-${value}`
|
||||
goto(newPath, { replaceState: true, noscroll: true, keepfocus: true })
|
||||
// Scroll to anchor
|
||||
setTimeout(() => smoothScroll('poster'), 1000)
|
||||
setTimeout(() => smoothScroll({ hash: 'poster' }), 1000)
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -107,7 +107,7 @@
|
||||
<ul>
|
||||
{#each shopLocations as { name, slug }}
|
||||
<li class:is-active={product && slug === product.location.slug}>
|
||||
<a href="/shop/poster-{slug}" on:click={() => smoothScroll('poster')} sveltekit:prefetch sveltekit:noscroll>
|
||||
<a href="/shop/poster-{slug}" on:click={() => smoothScroll({ hash: 'poster' })} sveltekit:prefetch sveltekit:noscroll>
|
||||
{name}
|
||||
</a>
|
||||
</li>
|
||||
|
||||
Reference in New Issue
Block a user