summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2020-09-12 21:54:59 +0300
committerAndrew Dolgov <[email protected]>2020-09-12 21:54:59 +0300
commite77cd07978a79988822bb9d806023d23cebc4150 (patch)
tree790449ce2c20c4d40546d84e2e58356d173e8b0c /js
parent9736e74c58eab637e5dc3fad22263bf6ee642585 (diff)
apply theme on rendition rendered hook
Diffstat (limited to 'js')
-rw-r--r--js/reader.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/js/reader.js b/js/reader.js
index a842a74..7cfb2ad 100644
--- a/js/reader.js
+++ b/js/reader.js
@@ -527,6 +527,8 @@ const Reader = {
rendition.on('rendered', function(/*chapter*/) {
$(".chapter").html($("<span>").addClass("glyphicon glyphicon-th-list"));
+ Reader.applyTheme();
+
Reader.resizeSideColumns();
try {
@@ -673,7 +675,7 @@ const Reader = {
if (EpubeApp.isNightMode())
theme = "night";
- console.log('theme', theme);
+ console.log('setting main UI theme', theme);
const theme_url = base_url + "themes/" + theme + ".css";
const theme_data = Reader.Loader._res_data[theme_url];
@@ -701,9 +703,14 @@ const Reader = {
}
/* apply to existing reader */
+ //$($("#reader iframe")[0].contentDocument).find("#theme_css").text(Reader.Loader._res_data[theme_url])
+
$.each(window.book.rendition.getContents(), function(i, c) {
+ console.log('applying rendition theme', theme);
+
$(c.document).find("#theme_css").text(Reader.Loader._res_data[theme_url])
});
+
});
},
hotkeyHandler: function(e) {