Explorar el Código

Fixed the form getting submitted for some browsers, probably

tags/v0.7.0
Fen Dweller hace 8 años
padre
commit
f42be577b2
Se han modificado 2 ficheros con 2 adiciones y 6 borrados
  1. +1
    -5
      game.js
  2. +1
    -1
      stroll.html

+ 1
- 5
game.js Ver fichero

@@ -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 Ver fichero

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


Cargando…
Cancelar
Guardar