aboutsummaryrefslogtreecommitdiff
path: root/src/main/resources/js/index.js
diff options
context:
space:
mode:
authorMarvin Borner2019-05-16 21:18:32 +0200
committerMarvin Borner2019-05-16 21:18:32 +0200
commitb5af1a221ebbc8f713ba01b61f308262f95bbf97 (patch)
treee493871c7129d285be7d2a9de34df8ff3f7c646f /src/main/resources/js/index.js
parent5cbb9d1ffe6ad4b7d89c0b189a7821d1005bbdda (diff)
Added manual file upload support and fixed some bugs
Co-authored-by: LarsVomMars <lars@kroenner.eu>
Diffstat (limited to 'src/main/resources/js/index.js')
-rw-r--r--src/main/resources/js/index.js14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/main/resources/js/index.js b/src/main/resources/js/index.js
index 4939622..6266978 100644
--- a/src/main/resources/js/index.js
+++ b/src/main/resources/js/index.js
@@ -1,6 +1,8 @@
-document.querySelector("#toggle").addEventListener("click", () => {
- const request = new XMLHttpRequest();
- request.open("POST", "/user/theme");
- request.onload = () => location.reload();
- request.send();
-});
+if (document.querySelector("#toggle") !== null) {
+ document.querySelector("#toggle").addEventListener("click", () => {
+ const request = new XMLHttpRequest();
+ request.open("POST", "/user/theme");
+ request.onload = () => location.reload();
+ request.send();
+ });
+}