summaryrefslogtreecommitdiff
path: root/js/reader.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2020-04-22 07:16:27 +0300
committerAndrew Dolgov <[email protected]>2020-04-22 07:16:27 +0300
commit71db8b9b4328278ee8a5fd13d55ef12b477a481e (patch)
tree9fd992552299e7ed520d7a6a9d388a32e33f4d31 /js/reader.js
parent2295bd1fccc31cc7b21400f1517e5a6cac5b5d14 (diff)
reader: override default theme in app night mode
Diffstat (limited to 'js/reader.js')
-rw-r--r--js/reader.js10
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];