aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTusooa Zhu <tusooa@kazv.moe>2021-08-02 20:03:01 -0400
committerTusooa Zhu <tusooa@kazv.moe>2022-03-13 12:00:44 -0400
commit839627ffc42f7ac2515ca58207b52e24f76f3369 (patch)
treec954ae4c21f45571d2ffb2918f6a8d6b7a592ec1
parentf3269cdc106511bc589dc68e71619a0d9581cd67 (diff)
Reset position on swipe end even if we cannot navigate
-rw-r--r--src/components/media_modal/media_modal.js7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/components/media_modal/media_modal.js b/src/components/media_modal/media_modal.js
index 3de9822b..91413563 100644
--- a/src/components/media_modal/media_modal.js
+++ b/src/components/media_modal/media_modal.js
@@ -81,7 +81,6 @@ const MediaModal = {
this.loading = true
}
this.$store.dispatch('setCurrentMedia', newMedia)
- this.$refs.pinchZoom.setTransform({ scale: 1, x: 0, y: 0 })
}
},
goNext () {
@@ -92,7 +91,6 @@ const MediaModal = {
this.loading = true
}
this.$store.dispatch('setCurrentMedia', newMedia)
- this.$refs.pinchZoom.setTransform({ scale: 1, x: 0, y: 0 })
}
},
onImageLoaded () {
@@ -103,9 +101,8 @@ const MediaModal = {
},
handleSwipeEnd (sign) {
console.log('handleSwipeEnd:', sign)
- if (sign === 0) {
- this.$refs.pinchZoom.setTransform({ scale: 1, x: 0, y: 0 })
- } else if (sign > 0) {
+ this.$refs.pinchZoom.setTransform({ scale: 1, x: 0, y: 0 })
+ if (sign > 0) {
this.goNext()
} else {
this.goPrev()