summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2020-04-21 11:28:14 +0300
committerAndrew Dolgov <[email protected]>2020-04-21 11:28:14 +0300
commit2c721e03a9ecee20f487568657c0aa8daa922e6c (patch)
tree8415cf079380f8b2d6df21c12c4ea66e93234099 /js
parent67e99b59ea134c0efc6e168cadd4b7a7591d5e43 (diff)
CSS fixes; pass offline events to the app
Diffstat (limited to 'js')
-rw-r--r--js/app.js14
-rw-r--r--js/reader.js1
2 files changed, 15 insertions, 0 deletions
diff --git a/js/app.js b/js/app.js
index 585726a..fcc8bfe 100644
--- a/js/app.js
+++ b/js/app.js
@@ -51,6 +51,7 @@ const App = {
}
App.initNightMode();
+ App.initOfflineEvents();
if ('serviceWorker' in navigator) {
navigator.serviceWorker
@@ -199,7 +200,19 @@ const App = {
});
}
},
+ initOfflineEvents: function() {
+ if (typeof EpubeApp != "undefined") {
+ $(window).on('online', function() {
+ EpubeApp.setOffline(false);
+ });
+
+ $(window).on('offline', function() {
+ EpubeApp.setOffline(true);
+ });
+ EpubeApp.setOffline(!navigator.onLine);
+ }
+ },
initNightMode: function() {
if (window.matchMedia) {
const mql = window.matchMedia('(prefers-color-scheme: dark)');
@@ -227,6 +240,7 @@ const App = {
}
App.initNightMode();
+ App.initOfflineEvents();
if ('serviceWorker' in navigator) {
navigator.serviceWorker
diff --git a/js/reader.js b/js/reader.js
index 2688d83..5758a80 100644
--- a/js/reader.js
+++ b/js/reader.js
@@ -639,6 +639,7 @@ const Reader = {
c.css("font-size", fontSize);
c.css("font-family", "'" + fontFamily + "'");
c.css("line-height", lineHeight);
+ c.css("text-align", "justify");
});
Reader.applyTheme();