Rearrange done and cancel buttons and dispose dialogs correctly (#1420)

This commit is contained in:
Matt Irvine
2018-05-15 15:39:27 -07:00
committed by GitHub
parent 078f3a2b54
commit 1a9f72dfe0
3 changed files with 7 additions and 9 deletions

View File

@@ -19,9 +19,8 @@ import { Disposable } from 'vs/base/common/lifecycle';
import Event, { Emitter } from 'vs/base/common/event';
export class DialogPane extends Disposable implements IThemable {
private _activeTabIndex: number;
private _tabbedPanel: TabbedPanel;
private _moduleRef: NgModuleRef<{}>;
private _moduleRefs: NgModuleRef<{}>[] = [];
// Validation
private _modelViewValidityMap = new Map<string, boolean>();
@@ -72,7 +71,6 @@ export class DialogPane extends Disposable implements IThemable {
}
});
this._activeTabIndex = 0;
return this._body;
}
@@ -89,7 +87,7 @@ export class DialogPane extends Disposable implements IThemable {
validityChangedCallback: (valid: boolean) => this._setValidity(modelViewId, valid)
} as DialogComponentParams,
undefined,
(moduleRef) => this._moduleRef = moduleRef);
(moduleRef) => this._moduleRefs.push(moduleRef));
}
public show(): void {
@@ -125,6 +123,6 @@ export class DialogPane extends Disposable implements IThemable {
public dispose() {
super.dispose();
this._moduleRef.destroy();
this._moduleRefs.forEach(moduleRef => moduleRef.destroy());
}
}