From f1b7bd59f67e719b7bfd203b0d7ec016fd21ab49 Mon Sep 17 00:00:00 2001 From: niubility000 <76441520+niubility000@users.noreply.github.com> Date: Mon, 8 Feb 2021 16:54:40 +0800 Subject: [PATCH] fix: double click to zoom pics in phone's browser (#1274) fixed this : https://github.com/filebrowser/filebrowser/issues/1266 --- frontend/src/components/files/ExtendedImage.vue | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/frontend/src/components/files/ExtendedImage.vue b/frontend/src/components/files/ExtendedImage.vue index 4cfe247e..0270c49b 100644 --- a/frontend/src/components/files/ExtendedImage.vue +++ b/frontend/src/components/files/ExtendedImage.vue @@ -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()