From 4a377b6a7a7586b02325160f2a32c9221d25f474 Mon Sep 17 00:00:00 2001 From: adrien Date: Mon, 24 Apr 2023 17:10:20 +0200 Subject: [PATCH] controls input type text --- app.js | 12 ++++++------ index.html | 18 +++++++++--------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/app.js b/app.js index 2596a87..8fa2588 100644 --- a/app.js +++ b/app.js @@ -404,14 +404,14 @@ class Settings { function changeKey(input) { prevValue = input.value - input.value = "Touche ?" + input.value = "" input.onkeydown = function (event) { event.preventDefault() input.value = KEY_NAMES[event.key] || event.key input.blur() } input.onblur = function (event) { - if (input.value == "Touche ?") input.value = prevValue + if (input.value == "") input.value = prevValue input.onkeydown = null input.onblur = null } @@ -597,6 +597,7 @@ function pause() { document.onkeydown = null resumeButton.disabled = false + settings.form.classList.remove('was-validated') settings.modal.show() settings.form.reportValidity() } @@ -629,11 +630,10 @@ function newGame(event) { function resume(event) { event.preventDefault() event.stopPropagation() + settings.form.reportValidity() + settings.form.classList.add('was-validated') - if (!settings.form.checkValidity()) { - settings.form.reportValidity() - settings.form.classList.add('was-validated') - } else { + if (settings.form.checkValidity()) { settings.load() settings.modal.hide() document.onkeydown = onkeydown diff --git a/index.html b/index.html index 3eb330c..2aabc66 100644 --- a/index.html +++ b/index.html @@ -29,10 +29,10 @@
- +
- +
- +
- +
- +
- +
- +
- +