Skip to content

Commit be7598d

Browse files
committed
Changed button setup for internal consistency
The buttons are now Cancel and Ok rather than Yes and No, they also have the correct order and color for the Ok button
1 parent d24b2d7 commit be7598d

File tree

1 file changed

+15
-17
lines changed

1 file changed

+15
-17
lines changed

src/modals/ConfirmOverwriteModal.ts

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,23 @@ export class ConfirmOverwriteModal extends Modal {
1717
contentEl.createEl('h2', { text: 'File already exists' });
1818
contentEl.createEl('p', { text: `The file "${this.fileName}" already exists. Do you want to overwrite it?` });
1919

20-
const buttonContainer = contentEl.createDiv({ cls: 'modal-button-container' });
20+
contentEl.createDiv({ cls: 'media-db-plugin-spacer' });
2121

22-
new Setting(buttonContainer)
23-
.addButton(btn => {
24-
btn.setButtonText('Yes');
25-
btn.onClick(() => {
26-
this.result = true;
27-
this.close();
28-
});
29-
btn.buttonEl.addClass('media-db-plugin-button');
30-
})
31-
.addButton(btn => {
32-
btn.setButtonText('No');
33-
btn.onClick(() => {
34-
this.result = false;
35-
this.close();
36-
});
37-
btn.buttonEl.addClass('media-db-plugin-button');
22+
const bottomSettingRow = new Setting(contentEl);
23+
bottomSettingRow.addButton(btn => {
24+
btn.setButtonText('Cancel');
25+
btn.onClick(() => this.close());
26+
btn.buttonEl.addClass('media-db-plugin-button');
27+
});
28+
bottomSettingRow.addButton(btn => {
29+
btn.setButtonText('Ok');
30+
btn.setCta();
31+
btn.onClick(() => {
32+
this.result = true;
33+
this.close();
3834
});
35+
btn.buttonEl.addClass('media-db-plugin-button');
36+
});
3937
}
4038

4139
onClose() {

0 commit comments

Comments
 (0)