Scale swipe threshold with viewport width
This commit is contained in:
parent
cb19db1006
commit
6980e4ddf1
3 changed files with 14 additions and 8 deletions
|
@ -33,7 +33,10 @@ const MediaModal = {
|
|||
return {
|
||||
loading: false,
|
||||
swipeDirection: GestureService.DIRECTION_LEFT,
|
||||
swipeThreshold: 50,
|
||||
swipeThreshold: () => {
|
||||
const considerableMoveRatio = 1 / 4
|
||||
return window.innerWidth * considerableMoveRatio
|
||||
},
|
||||
pinchZoomMinScale: 1,
|
||||
pinchZoomScaleResetLimit: 1.2
|
||||
}
|
||||
|
@ -104,7 +107,7 @@ const MediaModal = {
|
|||
this.$refs.pinchZoom.setTransform({ scale: 1, x: 0, y: 0 })
|
||||
if (sign > 0) {
|
||||
this.goNext()
|
||||
} else {
|
||||
} else if (sign < 0) {
|
||||
this.goPrev()
|
||||
}
|
||||
},
|
||||
|
|
|
@ -31,8 +31,8 @@ const SwipeClick = {
|
|||
type: Array
|
||||
},
|
||||
threshold: {
|
||||
type: Number,
|
||||
default: 30
|
||||
type: Function,
|
||||
default: () => 30
|
||||
},
|
||||
perpendicularTolerance: {
|
||||
type: Number,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue