update
Took 7 hours 48 minutes
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user