aboutsummaryrefslogtreecommitdiffstats
path: root/static/app.js
diff options
context:
space:
mode:
Diffstat (limited to 'static/app.js')
-rw-r--r--static/app.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/static/app.js b/static/app.js
index ce3ec62..d125d69 100644
--- a/static/app.js
+++ b/static/app.js
@@ -186,6 +186,16 @@ async function boot() {
showTab(tabs[saved] ? saved : "Dashboard");
}
+const fullscreenButton = document.getElementById("fullscreen");
+fullscreenButton?.addEventListener("click", async () => {
+ try {
+ if (document.fullscreenElement) await document.exitFullscreen();
+ else await document.documentElement.requestFullscreen();
+ } catch {
+ // the browser refused; nothing to do
+ }
+});
+
document.addEventListener("visibilitychange", () => {
if (document.visibilityState === "visible") refreshers.forEach((fn) => fn());
});