Skip to content

Commit

Permalink
fix: double click to zoom pics in phone's browser (#1274)
Browse files Browse the repository at this point in the history
fixed this : #1266
  • Loading branch information
niubility000 committed Feb 8, 2021
1 parent f3afd5c commit f1b7bd5
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions frontend/src/components/files/ExtendedImage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,15 @@ export default {
this.lastX = null
this.lastY = null
this.lastTouchDistance = null
if (event.targetTouches.length < 2) {
setTimeout(() => {
this.touches = 0
}, 300)
this.touches++
if (this.touches > 1) {
this.zoomAuto(event)
}
}
event.preventDefault()
},
zoomAuto(event) {
Expand All @@ -151,6 +160,7 @@ export default {
default:
case 4:
this.scale = 1
this.setCenter()
break
}
this.setZoom()
Expand Down

0 comments on commit f1b7bd5

Please sign in to comment.