From 7a4d8999ceaf1af736049bad5a59b9a32da0e57e Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Thu, 24 Jan 2019 01:13:03 +0700 Subject: [PATCH] =?UTF-8?q?=D0=A0=D0=B0=D0=B7=D1=80=D1=83=D0=BB=D0=B8?= =?UTF-8?q?=D0=BB=20onTouch=20=D0=B8=20onMouse?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/components/Reader/TextPage/TextPage.vue | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/client/components/Reader/TextPage/TextPage.vue b/client/components/Reader/TextPage/TextPage.vue index a20ad03e..4291e610 100644 --- a/client/components/Reader/TextPage/TextPage.vue +++ b/client/components/Reader/TextPage/TextPage.vue @@ -60,6 +60,7 @@ class TextPage extends Vue { }, 800); this.$root.$on('resize', () => {this.$nextTick(this.onResize)}); + this.mobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent); } mounted() { @@ -551,6 +552,8 @@ class TextPage extends Vue { } onTouchStart(event) { + if (!this.mobile) + return; this.endClickRepeat(); if (event.touches.length == 1) { const touch = event.touches[0]; @@ -564,14 +567,20 @@ class TextPage extends Vue { } onTouchEnd() { + if (!this.mobile) + return; this.endClickRepeat(); } onTouchCancel() { + if (!this.mobile) + return; this.endClickRepeat(); } onMouseDown(event) { + if (this.mobile) + return; this.endClickRepeat(); if (event.button == 0) { const x = event.pageX - this.canvas.offsetLeft; @@ -586,10 +595,14 @@ class TextPage extends Vue { } onMouseUp() { + if (this.mobile) + return; this.endClickRepeat(); } onMouseWheel(event) { + if (this.mobile) + return; if (event.deltaY > 0) { this.doDown(); } else if (event.deltaY < 0) {