Skip to content

Commit

Permalink
fix(webui): force pre-render of images in the webreader
Browse files Browse the repository at this point in the history
this works well on Firefox, but doesn't seem to have much effect on Safari and Chrome

Closes: #1323
  • Loading branch information
gotson committed Dec 4, 2023
1 parent 0a0eaca commit 7ab5eb3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions komga-webui/src/components/readers/PagedReader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
:key="`spread${i}`"
:eager="eagerLoad(i)"
class="full-height"
:class="preRender(i) ? 'pre-render' : ''"
:transition="animations ? undefined : false"
:reverse-transition="animations ? undefined : false"
>
Expand Down Expand Up @@ -219,6 +220,9 @@ export default Vue.extend({
eagerLoad(spreadIndex: number): boolean {
return Math.abs(this.carouselPage - spreadIndex) <= 2
},
preRender(spreadIndex: number): boolean {
return Math.abs(this.carouselPage - spreadIndex) > (this.animations ? 1 : 0)
},
centerClick() {
this.$emit('menu')
},
Expand Down Expand Up @@ -368,4 +372,10 @@ export default Vue.extend({
max-width: 50vw;
height: 100vh;
}
.pre-render {
display: block !important;
position: fixed;
right: -100vw;
}
</style>

0 comments on commit 7ab5eb3

Please sign in to comment.