Fix dialogs
parent
ccdaa571d8
commit
d9a7282929
|
@ -8,7 +8,7 @@ import { showToast } from "../speech";
|
|||
export class MergeDialog extends Dialog<boolean> {
|
||||
private channelList: Dropdown;
|
||||
private mergeButton: Button;
|
||||
private cancelButton: Button;
|
||||
protected cancelButton: Button;
|
||||
|
||||
public constructor() {
|
||||
super("Merge channels", false);
|
||||
|
|
|
@ -8,14 +8,14 @@ import { showToast } from "../speech";
|
|||
export class RemoveDialog extends Dialog<boolean> {
|
||||
private content: Text;
|
||||
private confirmButton: Button;
|
||||
private cancelButton: Button;
|
||||
protected cancelButton: Button;
|
||||
|
||||
public constructor(channelId: string) {
|
||||
super("Remove channel", false);
|
||||
this.content = new Text("Are you sure you want to remove this channel?");
|
||||
this.confirmButton = new Button("Remove");
|
||||
this.confirmButton.setPosition(30, 30, 40, 30);
|
||||
this.confirmButton.onClick(() => this.remove());
|
||||
this.confirmButton.onClick(() => this.doRemove());
|
||||
this.cancelButton = new Button("Cancel");
|
||||
this.cancelButton.setPosition(30, 70, 40, 30);
|
||||
this.cancelButton.onClick(() => this.cancel());
|
||||
|
@ -24,7 +24,7 @@ export class RemoveDialog extends Dialog<boolean> {
|
|||
this.add(this.cancelButton);
|
||||
}
|
||||
|
||||
private async remove() {
|
||||
private async doRemove() {
|
||||
try {
|
||||
const res = await API.deleteChannel(state.currentChannel!.id.toString());
|
||||
state.removeChannel(state.currentChannel!);
|
||||
|
|
|
@ -6,8 +6,8 @@ export class Dialog<T> extends UIWindow {
|
|||
private rejectPromise!: (reason?: any) => void;
|
||||
private promise: Promise<T>;
|
||||
private dialogElement!: HTMLDialogElement;
|
||||
private okButton?: Button;
|
||||
private cancelButton?: Button;
|
||||
protected okButton?: Button;
|
||||
protected cancelButton?: Button;
|
||||
|
||||
private previouslyFocusedElement!: HTMLElement;
|
||||
|
||||
|
|
Loading…
Reference in New Issue