Merge pull request #3942 from MinecraftPlaye/book-darktheme
Add epubjs theme support to the book player
This commit is contained in:
commit
e6d09f558b
1 changed files with 7 additions and 0 deletions
|
@ -9,6 +9,7 @@ import Screenfull from 'screenfull';
|
|||
import TableOfContents from './tableOfContents';
|
||||
import dom from '../../scripts/dom';
|
||||
import { translateHtml } from '../../scripts/globalize';
|
||||
import * as userSettings from '../../scripts/settings/userSettings';
|
||||
|
||||
import '../../elements/emby-button/paper-icon-button-light';
|
||||
|
||||
|
@ -294,6 +295,12 @@ export class BookPlayer {
|
|||
this.currentSrc = downloadHref;
|
||||
this.rendition = rendition;
|
||||
|
||||
rendition.themes.register('dark', { 'body': { 'color': '#fff' } });
|
||||
|
||||
if (userSettings.theme(undefined) === 'dark' || userSettings.theme(undefined) === null) {
|
||||
rendition.themes.select('dark');
|
||||
}
|
||||
|
||||
return rendition.display().then(() => {
|
||||
const epubElem = document.querySelector('.epub-container');
|
||||
epubElem.style.opacity = '0';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue