From d56fb62bd69f0be782b02ed2dcbe4c96b9d2ca0e Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 20 May 2018 18:46:06 +0300 Subject: use on-startup resource loading for iframe; and synchronouse switching for themes --- js/read.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'js') diff --git a/js/read.js b/js/read.js index 04b1e47..edbc2de 100644 --- a/js/read.js +++ b/js/read.js @@ -272,15 +272,11 @@ function apply_theme() { else theme = theme.replace("/", ""); - var themeUrl = baseUrl + "themes/" + theme + ".css"; + var theme_url = baseUrl + "themes/" + theme + ".css"; - $("#theme_css").attr("href", themeUrl); - //$(book.renderer.doc).find("#theme_css").attr('href', themeUrl); - - window.parent.$.get(baseUrl + 'themes/' + theme + '.css', function(data) { - $(book.renderer.doc).find("#theme_css").html(data); - }); + $("#theme_css").attr("href", theme_url); + $(book.renderer.doc).find("#theme_css").text(_res_data[theme_url]); }); } -- cgit v1.2.3