mirror of
https://framagit.org/JonathanMM/sutom.git
synced 2024-05-05 23:43:36 +02:00
Correction d'un problème avec le retour arrière sur safari
This commit is contained in:
parent
c932002970
commit
902d182fbf
|
@ -9,7 +9,7 @@ export default class Dictionnaire {
|
|||
|
||||
let numeroGrille = Math.floor((aujourdhui - origine) / (24 * 3600 * 1000));
|
||||
|
||||
return MotsATrouver.Liste[numeroGrille];
|
||||
return MotsATrouver.Liste[numeroGrille % MotsATrouver.Liste.length];
|
||||
}
|
||||
|
||||
public estMotValide(mot: string): boolean {
|
||||
|
|
|
@ -27,17 +27,15 @@ export default class Input {
|
|||
|
||||
if (touche === "Enter") {
|
||||
this.validerMot();
|
||||
} else if (touche === "Backspace") {
|
||||
this.effacerLettre();
|
||||
} else {
|
||||
this.saisirLettre(touche);
|
||||
}
|
||||
}).bind(this)
|
||||
);
|
||||
|
||||
// Le retour arrière n'est détecté que par keyup
|
||||
// Le retour arrière n'est détecté que par keydown
|
||||
document.addEventListener(
|
||||
"keyup",
|
||||
"keydown",
|
||||
((event: KeyboardEvent) => {
|
||||
event.stopPropagation();
|
||||
let touche = event.key;
|
||||
|
|
Loading…
Reference in a new issue