diff --git a/komga-webui/src/views/BookReader.vue b/komga-webui/src/views/BookReader.vue index 50a5eaf19..86fcf6708 100644 --- a/komga-webui/src/views/BookReader.vue +++ b/komga-webui/src/views/BookReader.vue @@ -10,6 +10,7 @@ >
+ + - - - - - + + + + + @@ -599,10 +603,7 @@ export default Vue.extend({ window.scrollTo(0, 0) } else { if (this.jumpToPreviousBook) { - if (!this.$_.isEmpty(this.siblingPrevious)) { - this.jumpToPreviousBook = false - this.$router.push({ name: 'read-book', params: { bookId: this.siblingPrevious.id.toString() } }) - } + this.previousBook() } else { this.jumpToPreviousBook = true } @@ -614,17 +615,26 @@ export default Vue.extend({ window.scrollTo(0, 0) } else { if (this.jumpToNextBook) { - if (this.$_.isEmpty(this.siblingNext)) { - this.closeBook() - } else { - this.jumpToNextBook = false - this.$router.push({ name: 'read-book', params: { bookId: this.siblingNext.id.toString() } }) - } + this.nextBook() } else { this.jumpToNextBook = true } } }, + nextBook () { + if (this.$_.isEmpty(this.siblingNext)) { + this.closeBook() + } else { + this.jumpToNextBook = false + this.$router.push({ name: 'read-book', params: { bookId: this.siblingNext.id.toString() } }) + } + }, + previousBook () { + if (!this.$_.isEmpty(this.siblingPrevious)) { + this.jumpToPreviousBook = false + this.$router.push({ name: 'read-book', params: { bookId: this.siblingPrevious.id.toString() } }) + } + }, goTo (page: number) { this.carouselPage = this.doublePages ? this.toDoublePages(page) - 1 : page - 1 },