From 1269c876e9fd772261f17e3284c359a60a14f84b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=91cze=20Bence?= Date: Sun, 14 Jun 2020 11:31:50 +0200 Subject: [PATCH] MAPG-138 use traditional for loop for compatibility --- public/static/js/mapguesser.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/public/static/js/mapguesser.js b/public/static/js/mapguesser.js index 92fef9e..f870be9 100644 --- a/public/static/js/mapguesser.js +++ b/public/static/js/mapguesser.js @@ -43,15 +43,16 @@ var MapGuesser = { var buttons = document.getElementById('modalButtons'); buttons.textContent = ''; - for (extraButton of extraButtons) { + for (var i = 0; i < extraButtons.length; i++) { + var extraButton = extraButtons[i]; var button = document.createElement(extraButton.type); if (extraButton.type === 'a') { button.classList.add('button'); } - for (className of extraButton.classNames) { - button.classList.add(className); + for (var i = 0; i < extraButton.classNames.length; i++) { + button.classList.add(extraButton.classNames[i]); } button.classList.add('marginTop'); @@ -82,8 +83,8 @@ var MapGuesser = { hideModal: function () { var modals = document.getElementsByClassName('modal'); - for (modal of modals) { - modal.style.visibility = 'hidden'; + for (var i = 0; i < modals.length; i++) { + modals[i].style.visibility = 'hidden'; } document.getElementById('cover').style.visibility = 'hidden';