Backup to open correctly from insights dialog (#5737)

* recreate modal dialog button to ensure onDidClick works properly

* fixing comment message

* Adding PR comments
This commit is contained in:
udeeshagautam
2019-05-30 12:32:38 -07:00
committed by GitHub
parent f9b7bc26c0
commit c4e59027fc
2 changed files with 19 additions and 1 deletions

View File

@@ -412,6 +412,22 @@ export abstract class Modal extends Disposable implements IThemable {
});
}
/**
* removes the footer button matching the provided label
* @param label Label on the button
*/
protected removeFooterButton(label: string): void {
let buttonIndex = this._footerButtons.findIndex(e => {
return e && e.element && e.element.innerText === label;
});
if (buttonIndex > -1 && buttonIndex < this._footerButtons.length) {
let button = this._footerButtons[buttonIndex];
DOM.removeNode(button.element);
button.dispose();
this._footerButtons.splice(buttonIndex, 1);
}
}
/**
* Show an error in the error message element
* @param message Text to show in the message