This commit is contained in:
@@ -77,11 +77,11 @@
|
||||
// On init, send an event to the Carousel component with the photoSlug to set currentIndex and then change the photo
|
||||
|
||||
// Pop event from browser (prev/next)
|
||||
// const changedUrl = event => {
|
||||
// dispatch('changedUrl', {
|
||||
// location: event.target.location
|
||||
// })
|
||||
// }
|
||||
const changedUrl = event => {
|
||||
dispatch('changedUrl', {
|
||||
currentPhoto: currentPhoto
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@@ -22,12 +22,12 @@
|
||||
*/
|
||||
let scope
|
||||
let firstLoad = true
|
||||
let previousPage
|
||||
|
||||
// 1. Watch page change
|
||||
page.subscribe(page => {
|
||||
if (!page.params.photo) {
|
||||
// Run the loader animation (only after first load)
|
||||
if (!firstLoad && process.browser) {
|
||||
if (!firstLoad) {
|
||||
animateIn(scope)
|
||||
}
|
||||
|
||||
@@ -35,7 +35,9 @@
|
||||
|
||||
// Set pageReady to false (?)
|
||||
pageReady.set(false)
|
||||
}
|
||||
|
||||
// Store current page
|
||||
previousPage = page
|
||||
})
|
||||
|
||||
// 2. Watch when loaded changes
|
||||
|
||||
Reference in New Issue
Block a user