mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
Started adding buttons
This commit is contained in:
14
client/src/controls/button.ts
Normal file
14
client/src/controls/button.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
export class Button
|
||||
{
|
||||
#container: HTMLElement | null;
|
||||
constructor(ID: string, srcs: string[], callback: CallableFunction)
|
||||
{
|
||||
this.#container = document.getElementById(ID);
|
||||
if (this.#container != null)
|
||||
{
|
||||
var img = document.createElement("img");
|
||||
img.src = srcs[0];
|
||||
this.#container.appendChild(img);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user