mirror of
https://framagit.org/JonathanMM/sutom.git
synced 2024-06-17 05:05:00 +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));
|
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 {
|
public estMotValide(mot: string): boolean {
|
||||||
|
|
|
@ -27,17 +27,15 @@ export default class Input {
|
||||||
|
|
||||||
if (touche === "Enter") {
|
if (touche === "Enter") {
|
||||||
this.validerMot();
|
this.validerMot();
|
||||||
} else if (touche === "Backspace") {
|
|
||||||
this.effacerLettre();
|
|
||||||
} else {
|
} else {
|
||||||
this.saisirLettre(touche);
|
this.saisirLettre(touche);
|
||||||
}
|
}
|
||||||
}).bind(this)
|
}).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(
|
document.addEventListener(
|
||||||
"keyup",
|
"keydown",
|
||||||
((event: KeyboardEvent) => {
|
((event: KeyboardEvent) => {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
let touche = event.key;
|
let touche = event.key;
|
||||||
|
|
Loading…
Reference in a new issue