fix: double click to zoom pics in phone's browser (#1274)

fixed this : https://github.com/filebrowser/filebrowser/issues/1266
This commit is contained in:
niubility000 2021-02-08 16:54:40 +08:00 committed by GitHub
parent f3afd5cb79
commit f1b7bd59f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 0 deletions

View File

@ -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) {
@ -151,6 +160,7 @@ export default {
default:
case 4:
this.scale = 1
this.setCenter()
break
}
this.setZoom()