diff options
author | Felix Bartels <felix@host-consultants.de> | 2019-12-19 15:35:11 +0100 |
---|---|---|
committer | Felix Bartels <felix@host-consultants.de> | 2019-12-19 15:35:11 +0100 |
commit | a489a0a3018499282824ae3124484dd6ab40710e (patch) | |
tree | 0a986dc2debe59da6d4e1cb03594caf6204c18f5 /app.js | |
parent | 05bdc2680193564dbb8acbd85aa8d79eeec546f5 (diff) | |
download | homer-a489a0a3018499282824ae3124484dd6ab40710e.tar.gz homer-a489a0a3018499282824ae3124484dd6ab40710e.tar.zst homer-a489a0a3018499282824ae3124484dd6ab40710e.zip |
Allow running Homer in a subdirectory
When running homer in a subpath the worker cannot be loaded (404) the same accounts for the images in the default configuration.
Signed-off-by: Felix Bartels <felix@host-consultants.de>
Diffstat (limited to 'app.js')
-rw-r--r-- | app.js | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -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 | ||
96 | if ('serviceWorker' in navigator) { | 96 | if ('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 | } |