From 1f410b5a18bbc9ac10364cd1605a04dc693afc52 Mon Sep 17 00:00:00 2001 From: Unrud Date: Wed, 26 Aug 2020 03:30:21 +0200 Subject: [PATCH] Only exit fullscreen when in fullscreen mode --- webdata/fn.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/webdata/fn.js b/webdata/fn.js index 9a018b2..627b748 100644 --- a/webdata/fn.js +++ b/webdata/fn.js @@ -318,7 +318,9 @@ window.addEventListener("load", function() { } function showKeys() { - exitFullscreen(); + if (fullscreenElement()) { + exitFullscreen(); + } showScene(keys); if (history.state != "keys") { history.pushState("keys", ""); @@ -326,7 +328,9 @@ window.addEventListener("load", function() { } function showKeyboard() { - exitFullscreen(); + if (fullscreenElement()) { + exitFullscreen(); + } showScene(keyboard); text.focus(); if (history.state != "keyboard") { @@ -359,7 +363,9 @@ window.addEventListener("load", function() { }; ws.onclose = function() { - exitFullscreen(); + if (fullscreenElement()) { + exitFullscreen(); + } showScene(closed); };