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:
2020-03-29 18:13:27 +02:00
parent 25fa9e1c07
commit ca07fe364e
6 changed files with 73 additions and 81 deletions

View File

@@ -22,9 +22,7 @@
photosToAppend.forEach(photo => photo.hidden = false)
// Merge new photos to show to the existing ones
dispatch('updatePagination', {
paginatedPhotos: [...paginatedPhotos, ...photosToAppend]
})
dispatch('updatePagination', [...paginatedPhotos, ...photosToAppend])
// Increment current index
currentIndex = currentIndex + photosPerPage