diff options
Diffstat (limited to 'js/reader.js')
-rw-r--r-- | js/reader.js | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/js/reader.js b/js/reader.js index 73aa73a..d58b9d2 100644 --- a/js/reader.js +++ b/js/reader.js @@ -648,12 +648,18 @@ const Reader = { }, applyTheme: function() { localforage.getItem("epube.theme").then(function(theme) { - console.log('theme', theme); - const base_url = window.location.href.match(/^.*\//)[0]; if (!theme) theme = 'default'; + console.log('called for theme', theme); + + if (theme == "default" && typeof EpubeApp != "undefined") + if (EpubeApp.isNightMode()) + theme = "night"; + + console.log('theme', theme); + const theme_url = base_url + "themes/" + theme + ".css"; const theme_data = Reader.Loader._res_data[theme_url]; |