mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
34 lines
749 B
TypeScript
34 lines
749 B
TypeScript
export class Control {
|
|
#container: HTMLElement | null;
|
|
expectedValue: any = null;
|
|
|
|
constructor(ID: string) {
|
|
this.#container = document.getElementById(ID);
|
|
}
|
|
|
|
show() {
|
|
if (this.#container != null)
|
|
this.#container.classList.remove("hide");
|
|
}
|
|
|
|
hide() {
|
|
if (this.#container != null)
|
|
this.#container.classList.add("hide");
|
|
}
|
|
|
|
getContainer() {
|
|
return this.#container;
|
|
}
|
|
|
|
setExpectedValue(expectedValue: any) {
|
|
this.expectedValue = expectedValue;
|
|
}
|
|
|
|
resetExpectedValue() {
|
|
this.expectedValue = null;
|
|
}
|
|
|
|
checkExpectedValue(value: any) {
|
|
return this.expectedValue === null || value === this.expectedValue;
|
|
}
|
|
} |