Bloquage du clavier quand le panel est activé

This commit is contained in:
JonathanMM 2022-02-21 22:14:25 +01:00
parent 7db79125f0
commit e274e46ebb
2 changed files with 11 additions and 0 deletions

View File

@ -71,6 +71,7 @@ export default class Gestionnaire {
.then((mot) => {
this._motATrouver = mot;
this._input = new Input(this, this._config, this._motATrouver.length, this._motATrouver[0]);
this._panelManager.setInput(this._input);
this._grille = new Grille(this._motATrouver.length, this._maxNbPropositions, this._motATrouver[0], this._audioPanel);
this._configurationPanel.setInput(this._input);
this._compositionMotATrouver = this.decompose(this._motATrouver);

View File

@ -1,3 +1,5 @@
import Input from "./input";
export default class PanelManager {
private readonly _panelArea: HTMLElement;
private readonly _panelFenetre: HTMLElement;
@ -5,6 +7,8 @@ export default class PanelManager {
private readonly _panelContenu: HTMLElement;
private readonly _panelFermetureBouton: HTMLElement;
private _input?: Input;
public constructor() {
this._panelArea = document.getElementById("panel-area") as HTMLElement;
this._panelFenetre = document.getElementById("panel-fenetre") as HTMLElement;
@ -36,12 +40,18 @@ export default class PanelManager {
);
}
public setInput(input: Input): void {
this._input = input;
}
public afficherPanel(): void {
this._panelArea.style.display = "block";
if (this._input) this._input.bloquer();
}
public cacherPanel(): void {
this._panelArea.style.display = "none";
if (this._input) this._input.debloquer();
}
public setContenu(titre: string, contenu: string): void {