From fe095cf435ab4aa443ec6376c878f2c58c2bf0be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=91cze=20Bence?= Date: Sun, 31 May 2020 03:50:06 +0200 Subject: [PATCH] MAPG-90 disable unload prevention and unify onbeforeunload script (loading animation) --- public/static/css/mapguesser.css | 1 + public/static/js/game.js | 11 ----------- views/maps.php | 7 ------- views/templates/main_footer.php | 5 +++++ 4 files changed, 6 insertions(+), 18 deletions(-) diff --git a/public/static/css/mapguesser.css b/public/static/css/mapguesser.css index 1effcbd..83f717e 100644 --- a/public/static/css/mapguesser.css +++ b/public/static/css/mapguesser.css @@ -231,6 +231,7 @@ div.mapItem>div.inner>div.info>p:nth-child(2) { margin-top: -32px; margin-left: -32px; z-index: 5; + visibility: hidden; } #roundInfo { diff --git a/public/static/js/game.js b/public/static/js/game.js index a8084c8..8ccb9b2 100644 --- a/public/static/js/game.js +++ b/public/static/js/game.js @@ -446,15 +446,4 @@ document.getElementById('startNewGameButton').onclick = function () { Core.resetGame(); } - - // showing the loading animation is not possible, because we don't know if user cancelled the leave - - window.onbeforeunload = function (e) { - if (Core.rounds[Core.rounds.length - 1].position) { - return; - } - - e.preventDefault(); - e.returnValue = ''; - }; })(); diff --git a/views/maps.php b/views/maps.php index 2aa4b18..d9cd188 100644 --- a/views/maps.php +++ b/views/maps.php @@ -44,11 +44,4 @@ - \ No newline at end of file diff --git a/views/templates/main_footer.php b/views/templates/main_footer.php index 691287b..864183a 100644 --- a/views/templates/main_footer.php +++ b/views/templates/main_footer.php @@ -1,2 +1,7 @@ + \ No newline at end of file