mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-18 17:22:45 -05:00
Add onClosed event to ModelView dialogs (#17531)
* Add onClosed event to ModelView dialogs * Use defined type * Fix compile * fix tests * fix tests2 * Remove unused
This commit is contained in:
@@ -133,6 +133,9 @@ class DialogImpl extends ModelViewPanelImpl implements azdata.window.Dialog {
|
||||
private _renderFooter: boolean;
|
||||
private _dialogProperties: IDialogProperties;
|
||||
|
||||
private _onClosed = new Emitter<azdata.window.CloseReason>();
|
||||
public onClosed = this._onClosed.event;
|
||||
|
||||
constructor(extHostModelViewDialog: ExtHostModelViewDialog,
|
||||
extHostModelView: ExtHostModelViewShape,
|
||||
extHostTaskManagement: ExtHostBackgroundTaskManagementShape,
|
||||
@@ -239,6 +242,10 @@ class DialogImpl extends ModelViewPanelImpl implements azdata.window.Dialog {
|
||||
return Promise.resolve(true);
|
||||
}
|
||||
}
|
||||
|
||||
public handleOnClosed(reason: azdata.window.CloseReason): void {
|
||||
this._onClosed.fire(reason);
|
||||
}
|
||||
}
|
||||
|
||||
class TabImpl extends ModelViewPanelImpl implements azdata.window.DialogTab {
|
||||
@@ -697,6 +704,11 @@ export class ExtHostModelViewDialog implements ExtHostModelViewDialogShape {
|
||||
return editor.handleSave();
|
||||
}
|
||||
|
||||
public $onClosed(handle: number, reason: azdata.window.CloseReason): void {
|
||||
let dialog = this._objectsByHandle.get(handle) as DialogImpl;
|
||||
dialog.handleOnClosed(reason);
|
||||
}
|
||||
|
||||
public openDialog(dialog: azdata.window.Dialog): void {
|
||||
let handle = this.getHandle(dialog);
|
||||
this.updateDialogContent(dialog);
|
||||
|
||||
Reference in New Issue
Block a user