Skip to content

Commit 190a29c

Browse files
committedAug 29, 2019
fixes #78934
1 parent b9eeccc commit 190a29c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed
 

‎src/vs/base/browser/ui/dialog/dialog.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,16 @@ export class Dialog extends Disposable {
5656
private styles: IDialogStyles | undefined;
5757
private focusToReturn: HTMLElement | undefined;
5858
private checkboxHasFocus: boolean = false;
59+
private buttons: string[];
5960

60-
constructor(private container: HTMLElement, private message: string, private buttons: string[], private options: IDialogOptions) {
61+
constructor(private container: HTMLElement, private message: string, buttons: string[], private options: IDialogOptions) {
6162
super();
6263
this.modal = this.container.appendChild($(`.dialog-modal-block${options.type === 'pending' ? '.dimmed' : ''}`));
6364
this.element = this.modal.appendChild($('.dialog-box'));
6465
hide(this.element);
6566

67+
// If no button is provided, default to OK
68+
this.buttons = buttons.length ? buttons : [nls.localize('ok', "OK")];
6669
const buttonsRowElement = this.element.appendChild($('.dialog-buttons-row'));
6770
this.buttonsContainer = buttonsRowElement.appendChild($('.dialog-buttons'));
6871

0 commit comments

Comments
 (0)