aboutsummaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2023-10-21 20:47:30 +0200
committermetamuffin <metamuffin@disroot.org>2023-10-21 20:47:30 +0200
commit539e48e3547040c05a84abc796b1778ab5472a8d (patch)
tree0629898ab932e84a423a63c8004052022452010b /web
parentb6139239e35d05621603a2b419bff4c0dc9cdf40 (diff)
downloadjellything-539e48e3547040c05a84abc796b1778ab5472a8d.tar
jellything-539e48e3547040c05a84abc796b1778ab5472a8d.tar.bz2
jellything-539e48e3547040c05a84abc796b1778ab5472a8d.tar.zst
back button only when js
Diffstat (limited to 'web')
-rw-r--r--web/script/backbutton.ts8
-rw-r--r--web/script/main.ts1
2 files changed, 9 insertions, 0 deletions
diff --git a/web/script/backbutton.ts b/web/script/backbutton.ts
new file mode 100644
index 0000000..c1225c0
--- /dev/null
+++ b/web/script/backbutton.ts
@@ -0,0 +1,8 @@
+import { e } from "./jshelper/mod.ts";
+
+globalThis.addEventListener("DOMContentLoaded", () => {
+ document.getElementsByTagName("nav").item(0)?.prepend(
+ e("a", "<- Back", { onclick() { history.back() } })
+ )
+})
+
diff --git a/web/script/main.ts b/web/script/main.ts
index e2a5045..dd168d5 100644
--- a/web/script/main.ts
+++ b/web/script/main.ts
@@ -5,3 +5,4 @@
*/
import "./player/mod.ts"
import "./transition.ts"
+import "./backbutton.ts"