diff --git a/src/components/media_modal/media_modal.js b/src/components/media_modal/media_modal.js index 0bc8a658..ffc7c365 100644 --- a/src/components/media_modal/media_modal.js +++ b/src/components/media_modal/media_modal.js @@ -65,14 +65,12 @@ const MediaModal = { if (this.canNavigate) { const prevIndex = this.currentIndex === 0 ? this.media.length - 1 : (this.currentIndex - 1) this.$store.dispatch('setCurrent', this.media[prevIndex]) - this.$refs.pinchZoom.setTransform({ scale: 1, x: 0, y: 0 }) } }, goNext () { if (this.canNavigate) { const nextIndex = this.currentIndex === this.media.length - 1 ? 0 : (this.currentIndex + 1) this.$store.dispatch('setCurrent', this.media[nextIndex]) - this.$refs.pinchZoom.setTransform({ scale: 1, x: 0, y: 0 }) } }, handleSwipePreview (offsets) { @@ -80,9 +78,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()