From c03995367a970f55eee549195dc21aeffe15d5cd Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Sun, 28 Jul 2024 17:45:18 +0700 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=BE=D0=BF=D1=80=D0=B0=D0=B2=D0=BA?= =?UTF-8?q?=D0=B8=20=D0=B1=D0=B0=D0=B3=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/Reader/TextPage/TextPage.vue | 32 +++++++++++-------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/client/components/Reader/TextPage/TextPage.vue b/client/components/Reader/TextPage/TextPage.vue index fd393296..503dac49 100644 --- a/client/components/Reader/TextPage/TextPage.vue +++ b/client/components/Reader/TextPage/TextPage.vue @@ -953,6 +953,22 @@ class TextPage { } } + doPara(paraIndex) { + const para = this.parsed.para[paraIndex]; + + if (para && this.pageLineCount > 0) { + const lines = this.parsed.getLines(para.offset, this.pageLineCount); + + if (lines.length >= this.pageLineCount) { + this.currentAnimation = this.pageChangeAnimation; + this.pageChangeDirectionDown = true; + this.userBookPosChange = true; + this.bookPos = lines[0].begin; + } else + this.doEnd(); + } + } + doToolBarToggle(event) { this.$emit('do-action', {action: 'switchToolbar', event}); } @@ -1267,25 +1283,15 @@ class TextPage { goToNotes() { const note = this.parsed.notes[this.noteId]; if (note && note.noteParaIndex >= 0) { - - const para = this.parsed.parsePara(note.noteParaIndex); - - this.userBookPosChange = true; - this.bookPos = para.lines[0].begin; - + this.doPara(note.noteParaIndex); this.noteDialogVisible = false; } } goToOrigNote(noteId) { const note = this.parsed.notes[noteId]; - if (note && note.noteParaIndex >= 0) { - - const para = this.parsed.parsePara(note.linkParaIndex); - - this.userBookPosChange = true; - this.bookPos = para.lines[0].begin; - + if (note && note.linkParaIndex >= 0) { + this.doPara(note.linkParaIndex); this.noteDialogVisible = false; } }