1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

fix epub theme selection

This commit is contained in:
Lukas Lüftinger 2023-03-08 16:43:52 +01:00
parent d75dbc1b3b
commit 2eb15411ba

View file

@ -240,7 +240,8 @@ export class BookPlayer {
rotateTheme() { rotateTheme() {
if (this.loaded) { if (this.loaded) {
const newTheme = this.themeOrder[(this.themeOrder.indexOf(this.theme) + 1) % this.themeOrder.length]; const newTheme = this.themeOrder[(this.themeOrder.indexOf(this.theme) + 1) % this.themeOrder.length];
this.rendition.themes.select(newTheme); this.rendition.themes.register('default', this.themes[newTheme]);
this.rendition.themes.update('default');
this.theme = newTheme; this.theme = newTheme;
} }
} }
@ -343,10 +344,8 @@ export class BookPlayer {
this.currentSrc = downloadHref; this.currentSrc = downloadHref;
this.rendition = rendition; this.rendition = rendition;
for (const theme of Object.keys(this.themes)) { rendition.themes.register('default', this.themes[this.theme])
rendition.themes.register(theme, this.themes[theme]); rendition.themes.select('default');
}
rendition.themes.select(this.theme);
return rendition.display().then(() => { return rendition.display().then(() => {
const epubElem = document.querySelector('.epub-container'); const epubElem = document.querySelector('.epub-container');