Merged in bugfix/MAPG-138-fix-js-minifying (pull request #111)

MAPG-138 use traditional for loop for compatibility
This commit is contained in:
Bence Pőcze 2020-06-14 09:33:54 +00:00
commit 142c91f36b

View File

@ -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';