From 00a10de5d15217aa3b671996b99f536475bc7ead Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Fri, 1 Feb 2019 01:15:46 +0700 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B4=D0=B5=D0=BB=D0=BA=D0=B8=20?= =?UTF-8?q?=D1=81=D0=BA=D1=80=D0=BE=D0=BB=D0=BB=D0=B8=D0=BD=D0=B3=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/components/Reader/Reader.vue | 10 +++++++--- client/components/Reader/TextPage/TextPage.vue | 5 ++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/client/components/Reader/Reader.vue b/client/components/Reader/Reader.vue index 092a4518..2c422599 100644 --- a/client/components/Reader/Reader.vue +++ b/client/components/Reader/Reader.vue @@ -53,7 +53,7 @@ @book-pos-changed="bookPosChanged" @tool-bar-toggle="toolBarToggle" @full-screen-toogle="fullScreenToggle" - @scrolling-toggle="scrollingToggle" + @stop-scrolling="stopScrolling" > @@ -250,8 +250,7 @@ class Reader extends Vue { this.setPositionActive = false; this.historyActive = false; this.settingsActive = false; - if (this.scrollingActive) - this.scrollingToggle(); + this.stopScrolling(); } loaderToggle() { @@ -276,6 +275,11 @@ class Reader extends Vue { } } + stopScrolling() { + if (this.scrollingActive) + this.scrollingToggle(); + } + scrollingToggle() { this.scrollingActive = !this.scrollingActive; if (this.activePage == 'TextPage') { diff --git a/client/components/Reader/TextPage/TextPage.vue b/client/components/Reader/TextPage/TextPage.vue index ac577819..e84ab89b 100644 --- a/client/components/Reader/TextPage/TextPage.vue +++ b/client/components/Reader/TextPage/TextPage.vue @@ -367,7 +367,6 @@ class TextPage extends Vue { this.page1 = null; this.page2 = null; this.statusBar = null; - await this.stopTextScrolling(); this.calcDrawProps(); this.setBackground(); @@ -394,7 +393,7 @@ class TextPage extends Vue { async startTextScrolling() { if (this.doingScrolling || !this.book || !this.parsed.textLength || !this.linesDown || this.pageLineCount < 1 || this.linesDown.length <= this.pageLineCount) { - this.$emit('scrolling-toggle'); + this.$emit('stop-scrolling'); return; } @@ -427,7 +426,6 @@ class TextPage extends Vue { if (i > 0) { this.doDown(); if (this.linesDown.length <= this.pageLineCount + 1) { - this.$emit('scrolling-toggle'); this.stopScrolling = true; } } @@ -439,6 +437,7 @@ class TextPage extends Vue { } this.resolveTransitionFinish = null; this.doingScrolling = false; + this.$emit('stop-scrolling'); } async stopTextScrolling() {