From cdbcb6ca5276745c4a4cb017869f1aa92356505f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=91cze=20Bence?= Date: Thu, 21 May 2020 01:59:31 +0200 Subject: [PATCH] MAPG-35 adapt JS to mobile layout use null instead of explicit value when reset --- public/static/js/mapguesser.js | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/public/static/js/mapguesser.js b/public/static/js/mapguesser.js index f4704dd..1da83ee 100644 --- a/public/static/js/mapguesser.js +++ b/public/static/js/mapguesser.js @@ -172,6 +172,16 @@ Core.getNewPosition(); + document.getElementById('showGuessButton').onclick = function () { + this.style.visibility = 'hidden'; + document.getElementById('guess').style.visibility = 'visible'; + } + + document.getElementById('closeGuessButton').onclick = function () { + document.getElementById('showGuessButton').style.visibility = null; + document.getElementById('guess').style.visibility = null; + } + document.getElementById('guessButton').onclick = function () { if (!Core.guessMarker) { return; @@ -231,15 +241,16 @@ } document.getElementById('continueButton').onclick = function () { - document.getElementById('scoreBar').style.width = '0'; + document.getElementById('scoreBar').style.width = null; Core.resultMarkers.real.setMap(null); Core.resultMarkers.real = null; Core.resultMarkers.guess.setMap(null); Core.resultMarkers.guess = null; - document.getElementById('guess').style.visibility = 'visible'; - document.getElementById('result').style.visibility = 'hidden'; + document.getElementById('showGuessButton').style.visibility = null; + document.getElementById('guess').style.visibility = null; + document.getElementById('result').style.visibility = null; Core.guessMap.fitBounds(guessMapBounds);