mirror of
https://github.com/gotson/komga.git
synced 2026-05-09 05:10:19 +02:00
parent
cb065d7d0e
commit
1a030b4db5
1 changed files with 6 additions and 5 deletions
|
|
@ -10,7 +10,7 @@
|
||||||
:height="page.height / (page.width / $vuetify.breakpoint.width)"
|
:height="page.height / (page.width / $vuetify.breakpoint.width)"
|
||||||
:width="$vuetify.breakpoint.width"
|
:width="$vuetify.breakpoint.width"
|
||||||
:id="`page${page.number}`"
|
:id="`page${page.number}`"
|
||||||
v-intersect.once="onIntersect"
|
v-intersect="onIntersect"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
@ -105,13 +105,14 @@ export default Vue.extend({
|
||||||
},
|
},
|
||||||
onIntersect (entries: any) {
|
onIntersect (entries: any) {
|
||||||
if (entries[0].isIntersecting) {
|
if (entries[0].isIntersecting) {
|
||||||
this.currentPage = parseInt(entries[0].target.id.replace('page', ''))
|
const page = parseInt(entries[0].target.id.replace('page', ''))
|
||||||
this.seen.splice(this.currentPage - 1, 1, true)
|
this.seen.splice(page - 1, 1, true)
|
||||||
this.$emit('update:page', this.currentPage)
|
this.currentPage = page
|
||||||
|
this.$emit('update:page', page)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
shouldLoad (page: number): boolean {
|
shouldLoad (page: number): boolean {
|
||||||
return this.seen[page] || Math.abs((this.currentPage - 1) - page) <= 2
|
return page == 0 || this.seen[page] || Math.abs((this.currentPage - 1) - page) <= 2
|
||||||
},
|
},
|
||||||
centerClick () {
|
centerClick () {
|
||||||
this.$emit('menu')
|
this.$emit('menu')
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue