diff options
author | Andrew Dolgov <[email protected]> | 2020-04-21 14:04:37 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2020-04-21 14:04:37 +0300 |
commit | 7c8692a40c6cdbcb704fa0bc9db2b99a5d314b73 (patch) | |
tree | 64260a710d3f78a2b63b6c479f342f2d4ca92f80 | |
parent | 09942cf787798d82bfdacc9df533352a1970d337 (diff) |
support for app-provided limited night mode in index
-rw-r--r-- | js/app.js | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -214,6 +214,13 @@ const App = { }
},
initNightMode: function() {
+ if (typeof EpubeApp != "undefined") {
+ if (!EpubeApp.isAutoNightModeSupported()) {
+ App.applyNightMode(EpubeApp.isNightMode());
+ return;
+ }
+ }
+
if (window.matchMedia) {
const mql = window.matchMedia('(prefers-color-scheme: dark)');
|