From 0805353a9e5aee0bc545d8f289339d1a31798732 Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Fri, 15 Feb 2019 19:20:50 +0700 Subject: [PATCH] =?UTF-8?q?=D0=9D=D0=B0=D1=87=D0=B0=D0=BB=D0=BE=20=D1=80?= =?UTF-8?q?=D0=B0=D0=B1=D0=BE=D1=82=D1=8B=20=D0=BD=D0=B0=D0=B4=20=D0=B0?= =?UTF-8?q?=D0=BD=D0=B8=D0=BC=D0=B0=D1=86=D0=B8=D0=B5=D0=B9=20=D0=BF=D0=B5?= =?UTF-8?q?=D1=80=D0=B5=D0=BB=D0=B8=D1=81=D1=82=D1=8B=D0=B2=D0=B0=D0=BD?= =?UTF-8?q?=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/Reader/TextPage/TextPage.vue | 38 +++++++++++++------ 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/client/components/Reader/TextPage/TextPage.vue b/client/components/Reader/TextPage/TextPage.vue index 1b1b6a04..2e55c60e 100644 --- a/client/components/Reader/TextPage/TextPage.vue +++ b/client/components/Reader/TextPage/TextPage.vue @@ -5,12 +5,14 @@
-
+
-
+
+
+
@@ -60,6 +62,9 @@ export default @Component({ toggleLayout: function() { this.updateLayout(); }, + inTransition: function() { + this.updateLayout(); + }, }, }) class TextPage extends Vue { @@ -81,6 +86,9 @@ class TextPage extends Vue { fontStyle = null; fontSize = null; fontName = null; + fontWeight = null; + + inTransition = false; meta = null; @@ -378,7 +386,10 @@ class TextPage extends Vue { } updateLayout() { - if (this.toggleLayout) { + if (this.inTransition) { + this.$refs.scrollBox1.style.visibility = 'visible'; + this.$refs.scrollBox2.style.visibility = 'visible'; + } else if (this.toggleLayout) { this.$refs.scrollBox1.style.visibility = 'visible'; this.$refs.scrollBox2.style.visibility = 'hidden'; } else { @@ -463,7 +474,7 @@ class TextPage extends Vue { await sleep(50); this.cachedPos = -1; - const page = this.$refs.scrollingPage; + const page = this.$refs.scrollingPage1; let i = 0; while (!this.stopScrolling) { page.style.transition = `${this.scrollingDelay}ms ${this.scrollingType}`; @@ -489,7 +500,7 @@ class TextPage extends Vue { async stopTextScrolling() { this.stopScrolling = true; - const page = this.$refs.scrollingPage; + const page = this.$refs.scrollingPage1; page.style.transition = ''; page.style.transform = 'none'; page.offsetHeight; @@ -498,6 +509,7 @@ class TextPage extends Vue { } draw() { + //scrolling if (this.doingScrolling) { if (this.cachedPos == this.bookPos) { this.linesDown = this.linesCached.linesDown; @@ -526,6 +538,7 @@ class TextPage extends Vue { return; } + //check if (this.w < minLayoutWidth) { this.page1 = null; this.page2 = null; @@ -538,13 +551,13 @@ class TextPage extends Vue { return; } - + //fast draw prepared if (this.pageChangeDirectionDown && this.pagePrepared && this.bookPos == this.bookPosPrepared) { this.toggleLayout = !this.toggleLayout; this.linesDown = this.linesDownNext; this.linesUp = this.linesUpNext; this.doPageTransition(); - } else { + } else {//normal debounced draw const lines = this.getLines(this.bookPos); this.linesDown = lines.linesDown; this.linesUp = lines.linesUp; @@ -555,18 +568,21 @@ class TextPage extends Vue { this.debouncedPrepareNextPage(); this.debouncedDrawStatusBar(); - if (this.book && this.linesDown && this.linesDown.length < this.pageLineCount) + if (this.book && this.linesDown && this.linesDown.length < this.pageLineCount) { this.doEnd(); + return; + } } - doPageTransition() { + async doPageTransition() { if (this.currentTransition) { + this.inTransition = true; + //switch () //this.currentTransition //this.pageChangeTransitionSpeed //this.pageChangeDirectionDown - //curr to next transition - //пока заглушка + this.inTransition = false; } this.currentTransition = '';