Viewer: Finally fix Carousel navigation depending on URL
- Instead of detecting every case using popState event or whatnot, used a Sapper page stores subscribe to go to the current photo from the URL param (findIndex in photos) - No page transition when navigating between photos in Viewer, but runs In and Out - Also shortened dispatches to direct value over an object
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
class:active={index === currentIndex}
|
||||
class:small={index < currentIndex - 2 || index > currentIndex + 2}
|
||||
class:hidden={index < currentIndex - 3 || index > currentIndex + 3}
|
||||
on:click={() => dispatch('goToIndex', { index })}
|
||||
on:click={() => dispatch('goToIndex', index)}
|
||||
>
|
||||
<button aria-label="Go to photo #{index + 1}"></button>
|
||||
</li>
|
||||
|
||||
Reference in New Issue
Block a user