Took 7 hours 48 minutes
This commit is contained in:
2022-11-17 23:29:33 +01:00
parent c81713cd23
commit 03dd0e0fb6
20 changed files with 642 additions and 211 deletions

View File

@ -44,7 +44,7 @@ export class Modal {
this._loader = value;
}
public addButton(type: ButtonType, content: string, onclick: Function): HTMLButtonElement {
public addButton(type: ButtonType, content: string, onclick: Function = () => {}): HTMLButtonElement {
let btn = document.createElement("button");
btn.classList.add("btn", "btn-" + type);
btn.onclick = () => onclick(btn);
@ -55,6 +55,8 @@ export class Modal {
return btn;
}
public open(): Promise<void> {
return new Promise(async (resolve) => {
/* if (this._leftCentered) {
@ -119,6 +121,10 @@ export class Modal {
}
public close() : void {
Modal.close(this._id);
}
public static close(id?: string): void {
if (id && this.currentModalId != id)
return;