mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-17 17:22:42 -05:00
make custom buttons already secondary (#16812)
* make custom buttons already secondary * move the logic to a single place
This commit is contained in:
@@ -753,8 +753,7 @@ export class ExtHostModelViewDialog implements ExtHostModelViewDialogShape {
|
||||
|
||||
if (dialog.customButtons) {
|
||||
dialog.customButtons.forEach(button => {
|
||||
button.secondary = true;
|
||||
this.updateButton(button);
|
||||
this.updateButton(button, true);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -797,7 +796,11 @@ export class ExtHostModelViewDialog implements ExtHostModelViewDialogShape {
|
||||
});
|
||||
}
|
||||
|
||||
public updateButton(button: azdata.window.Button): void {
|
||||
public updateButton(button: azdata.window.Button, isCustomButton: boolean = false): void {
|
||||
// Custom buttons are always secondary buttons.
|
||||
if (isCustomButton) {
|
||||
button.secondary = true;
|
||||
}
|
||||
let handle = this.getHandle(button);
|
||||
this._proxy.$setButtonDetails(handle, {
|
||||
label: button.label,
|
||||
@@ -888,7 +891,9 @@ export class ExtHostModelViewDialog implements ExtHostModelViewDialogShape {
|
||||
public updateWizardPage(page: azdata.window.WizardPage): Thenable<void> {
|
||||
let handle = this.getHandle(page);
|
||||
if (page.customButtons) {
|
||||
page.customButtons.forEach(button => this.updateButton(button));
|
||||
page.customButtons.forEach(button => {
|
||||
this.updateButton(button, true);
|
||||
});
|
||||
}
|
||||
return this._proxy.$setWizardPageDetails(handle, {
|
||||
content: page.content,
|
||||
@@ -910,8 +915,7 @@ export class ExtHostModelViewDialog implements ExtHostModelViewDialogShape {
|
||||
this.updateButton(wizard.nextButton);
|
||||
if (wizard.customButtons) {
|
||||
wizard.customButtons.forEach(button => {
|
||||
button.secondary = true;
|
||||
this.updateButton(button);
|
||||
this.updateButton(button, true);
|
||||
});
|
||||
}
|
||||
return this._proxy.$setWizardDetails(handle, {
|
||||
|
||||
Reference in New Issue
Block a user