Fix Fullscreen double click bug, Default size for photos

- Reset the value of swiped when changing photo
This commit is contained in:
2020-04-08 14:33:06 +02:00
parent b28fd9b8fe
commit 6ff05fea48
2 changed files with 5 additions and 2 deletions

View File

@@ -55,7 +55,7 @@
<source media="(min-width: 768px)" data-srcset={getThumbnail(private_hash, 992)}> <source media="(min-width: 768px)" data-srcset={getThumbnail(private_hash, 992)}>
<source media="(min-width: 500px)" data-srcset={getThumbnail(private_hash, 650)}> <source media="(min-width: 500px)" data-srcset={getThumbnail(private_hash, 650)}>
<source media="(min-width: 300px)" data-srcset={getThumbnail(private_hash, 400)}> <source media="(min-width: 300px)" data-srcset={getThumbnail(private_hash, 400)}>
<img src={layout === 'list' ? 'data:image/png;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=' : getThumbnail(private_hash, 900)} <img src={getThumbnail(private_hash, 900)}
width={defaultWidth} height={defaultHeight} width={defaultWidth} height={defaultHeight}
alt={imgAlt} alt={imgAlt}
class:lazyload={layout === 'list'} class:lazyload={layout === 'list'}

View File

@@ -55,6 +55,8 @@
dispatch('photoChange', photos[currentIndex]) dispatch('photoChange', photos[currentIndex])
// Reset fullscreen value if open // Reset fullscreen value if open
if ($fullscreen) fullscreen.set() if ($fullscreen) fullscreen.set()
// Reset swiped event if fired
swiped = false
} }
// Hover on controls // Hover on controls
@@ -96,6 +98,7 @@
const swipe = directions => { const swipe = directions => {
swiped = true swiped = true
// Detect swipe direction
if (directions.right) { if (directions.right) {
goToPhoto('prev') goToPhoto('prev')
} else if (directions.left) { } else if (directions.left) {
@@ -159,7 +162,7 @@
<source media="(min-width: 800px)" data-srcset={getThumbnail(image.private_hash, 900)}> <source media="(min-width: 800px)" data-srcset={getThumbnail(image.private_hash, 900)}>
<source media="(min-width: 500px)" data-srcset={getThumbnail(image.private_hash, 600)}> <source media="(min-width: 500px)" data-srcset={getThumbnail(image.private_hash, 600)}>
<source media="(min-width: 300px)" data-srcset={getThumbnail(image.private_hash, 400)}> <source media="(min-width: 300px)" data-srcset={getThumbnail(image.private_hash, 400)}>
<img src="data:image/png;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=" <img src={getThumbnail(image.private_hash, 900)}
alt="{name}, {location.name}, {location.country.name}" alt="{name}, {location.name}, {location.country.name}"
width={defaultWidth} height={defaultHeight} width={defaultWidth} height={defaultHeight}
class:lazyload={ class:lazyload={