Selaa lähdekoodia

Fixed the form getting submitted for some browsers, probably

tags/v0.7.0
Fen Dweller 8 vuotta sitten
vanhempi
commit
f42be577b2
2 muutettua tiedostoa jossa 2 lisäystä ja 6 poistoa
  1. +1
    -5
      game.js
  2. +1
    -1
      stroll.html

+ 1
- 5
game.js Näytä tiedosto

@@ -1017,8 +1017,6 @@ function preset(name) {
}

function startGame(e) {
if (e.preventDefault)
e.preventDefault();

form = document.forms.namedItem("custom-species-form");

@@ -1109,8 +1107,6 @@ function startGame(e) {
update();

document.getElementById("stat-container").style.display = 'flex';

return false;
}

window.addEventListener('load', function(event) {
@@ -1142,6 +1138,6 @@ window.addEventListener('load', function(event) {
document.getElementById("button-verbose").addEventListener("click",toggle_verbose);
document.getElementById("button-grow-lots").addEventListener("click",grow_lots);

document.getElementById("custom-species-form").addEventListener("submit",startGame);
document.getElementById("button-start").addEventListener("click",startGame);
setTimeout(pick_move, 2000);
});

+ 1
- 1
stroll.html Näytä tiedosto

@@ -139,8 +139,8 @@
</div>
</div>
</ul>
<input type="submit" value="Start game" class=option-button id=button-start></button>
</form>
<button class=option-button id=button-start>Start Game</button>
</div>
</div>
</div>


Loading…
Peruuta
Tallenna