From 2eb15411baf43b435b5d435bbcff39c594a201e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20L=C3=BCftinger?= Date: Wed, 8 Mar 2023 16:43:52 +0100 Subject: [PATCH] fix epub theme selection --- src/plugins/bookPlayer/plugin.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/plugins/bookPlayer/plugin.js b/src/plugins/bookPlayer/plugin.js index 7e06a482a8..ee3fddd6e2 100644 --- a/src/plugins/bookPlayer/plugin.js +++ b/src/plugins/bookPlayer/plugin.js @@ -240,7 +240,8 @@ export class BookPlayer { rotateTheme() { if (this.loaded) { 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; } } @@ -343,10 +344,8 @@ export class BookPlayer { this.currentSrc = downloadHref; this.rendition = rendition; - for (const theme of Object.keys(this.themes)) { - rendition.themes.register(theme, this.themes[theme]); - } - rendition.themes.select(this.theme); + rendition.themes.register('default', this.themes[this.theme]) + rendition.themes.select('default'); return rendition.display().then(() => { const epubElem = document.querySelector('.epub-container');