aboutsummaryrefslogtreecommitdiffhomepage
path: root/app.js
diff options
context:
space:
mode:
authorBastien Wirtz <bastien.wirtz@gmail.com>2019-12-27 10:38:52 -0800
committerGitHub <noreply@github.com>2019-12-27 10:38:52 -0800
commit5738264ea00221c0ca128d5e7f74d31a8ec0490c (patch)
treeadd32e4d4e5a204d2de78430a394446878053150 /app.js
parent05bdc2680193564dbb8acbd85aa8d79eeec546f5 (diff)
parentd819cf5c15c26ae0e7128b8a1230c65201fa4d0e (diff)
downloadhomer-5738264ea00221c0ca128d5e7f74d31a8ec0490c.tar.gz
homer-5738264ea00221c0ca128d5e7f74d31a8ec0490c.tar.zst
homer-5738264ea00221c0ca128d5e7f74d31a8ec0490c.zip
Merge pull request #8 from fbartels/subdir
Allow running Homer in a subdirectory
Diffstat (limited to 'app.js')
-rw-r--r--app.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/app.js b/app.js
index def0be7..40830da 100644
--- a/app.js
+++ b/app.js
@@ -9,14 +9,14 @@ const app = new Vue({
9 }, 9 },
10 created: function () { 10 created: function () {
11 let that = this; 11 let that = this;
12 12
13 this.isDark = 'overrideDark' in localStorage ? 13 this.isDark = 'overrideDark' in localStorage ?
14 JSON.parse(localStorage.overrideDark) : matchMedia("(prefers-color-scheme: dark)").matches; 14 JSON.parse(localStorage.overrideDark) : matchMedia("(prefers-color-scheme: dark)").matches;
15 15
16 if ('vlayout' in localStorage) { 16 if ('vlayout' in localStorage) {
17 this.vlayout = JSON.parse(localStorage.vlayout) 17 this.vlayout = JSON.parse(localStorage.vlayout)
18 } 18 }
19 19
20 this.checkOffline(); 20 this.checkOffline();
21 that.getConfig().then(function (config) { 21 that.getConfig().then(function (config) {
22 that.config = config; 22 that.config = config;
@@ -58,8 +58,8 @@ const app = new Vue({
58 }, 58 },
59 toggleLayout: function() { 59 toggleLayout: function() {
60 this.vlayout = !this.vlayout; 60 this.vlayout = !this.vlayout;
61 localStorage.vlayout = this.vlayout; 61 localStorage.vlayout = this.vlayout;
62 }, 62 },
63 } 63 }
64}); 64});
65 65
@@ -95,6 +95,6 @@ Vue.component('service', {
95 95
96if ('serviceWorker' in navigator) { 96if ('serviceWorker' in navigator) {
97 window.addEventListener('load', function () { 97 window.addEventListener('load', function () {
98 navigator.serviceWorker.register('/worker.js'); 98 navigator.serviceWorker.register('worker.js');
99 }); 99 });
100} 100}