aboutsummaryrefslogtreecommitdiff
path: root/src/components/media_modal/media_modal.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/media_modal/media_modal.js')
-rw-r--r--src/components/media_modal/media_modal.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/components/media_modal/media_modal.js b/src/components/media_modal/media_modal.js
index 8f67db2b..04dd8658 100644
--- a/src/components/media_modal/media_modal.js
+++ b/src/components/media_modal/media_modal.js
@@ -61,7 +61,7 @@ const MediaModal = {
return this.$store.state.mediaViewer.swipeScaler.offsets
},
transform () {
- return `scale(${this.scaling}, ${this.scaling}) translate(${this.offsets[0]}px, ${this.offsets[1]}px)`
+ return `translate(${this.offsets[0]}px, ${this.offsets[1]}px) scale(${this.scaling}, ${this.scaling})`
}
},
created () {
@@ -71,6 +71,8 @@ const MediaModal = {
callbackNegative: this.goPrev,
swipePreviewCallback: this.handleSwipePreview,
swipeEndCallback: this.handleSwipeEnd,
+ pinchPreviewCallback: this.handlePinchPreview,
+ pinchEndCallback: this.handlePinchEnd,
threshold: 50
})
},
@@ -125,6 +127,13 @@ const MediaModal = {
this.goPrev()
}
},
+ handlePinchPreview (offsets, scaling) {
+ console.log('handle pinch preview:', offsets, scaling)
+ this.$store.dispatch('swipeScaler/apply', { offsets, scaling })
+ },
+ handlePinchEnd () {
+ this.$store.dispatch('swipeScaler/finish')
+ },
handleKeyupEvent (e) {
if (this.showing && e.keyCode === 27) { // escape
this.hide()