Viewer: Fix Carousel and error page
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
@@ -71,11 +71,13 @@
|
||||
const photoChanged = event => {
|
||||
const currentPhoto = event.detail
|
||||
const windowPathname = window.location.pathname
|
||||
const newUrl = windowPathname.substring(0, windowPathname.lastIndexOf('/') + 1) + currentPhoto.slug
|
||||
// Go to page via a sapper-noscroll link to avoid scroll jump (hacky)
|
||||
if (gotoLink && newUrl) {
|
||||
gotoLink.href = newUrl
|
||||
gotoLink.click()
|
||||
if (currentPhoto) {
|
||||
const newUrl = windowPathname.substring(0, windowPathname.lastIndexOf('/') + 1) + currentPhoto.slug
|
||||
// Go to page via a sapper-noscroll link to avoid scroll jump (hacky)
|
||||
if (gotoLink && newUrl) {
|
||||
gotoLink.href = newUrl
|
||||
gotoLink.click()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,10 +118,12 @@
|
||||
<circle cx="50%" cy="50%" r="{windowWidth >= 768 ? 32 : 24}px"></circle>
|
||||
</svg>
|
||||
</a>
|
||||
{#if $currentLocation}
|
||||
<a href="/location/{$currentLocation.country.slug}/{$currentLocation.slug}" class="button-control button-control--pink dir-bottom" aria-label="Back to photos" rel="prefetch">
|
||||
<IconCross color="#fff" width="18" class="icon" />
|
||||
<IconCross color="#fff" width="18" class="icon" hidden="true" />
|
||||
</a>
|
||||
{/if}
|
||||
</div>
|
||||
<a href="/" bind:this={gotoLink} aria-hidden="true" hidden class="hidden" sapper-noscroll> </a>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user