Fix view destroyed errors (#10119)

This commit is contained in:
Charles Gagnon
2020-04-22 09:50:37 -07:00
committed by GitHub
parent cd34236f30
commit 883dcc9789

View File

@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import 'vs/css!./media/propertiesContainer';
import { Component, Inject, forwardRef, ChangeDetectorRef, OnInit, ElementRef } from '@angular/core';
import { Component, Inject, forwardRef, ChangeDetectorRef, OnInit, ElementRef, OnDestroy } from '@angular/core';
import { EventType, addDisposableListener } from 'vs/base/browser/dom';
import * as nls from 'vs/nls';
import { Disposable } from 'vs/base/common/lifecycle';
@@ -32,7 +32,7 @@ const verticalPropertyHeight = 46;
selector: 'properties-container',
templateUrl: decodeURI(require.toUrl('./propertiesContainer.component.html'))
})
export class PropertiesContainer extends Disposable implements OnInit {
export class PropertiesContainer extends Disposable implements OnInit, OnDestroy {
public gridDisplayLayout = GridDisplayLayout.twoColumns;
public propertyLayout = PropertyLayoutDirection.row;
public loadingMessage: string = nls.localize('loadingProperties', "Loading properties");
@@ -54,6 +54,10 @@ export class PropertiesContainer extends Disposable implements OnInit {
this._changeRef.detectChanges();
}
ngOnDestroy() {
this.dispose();
}
private layoutDisplayProperties(): void {
// Reflow:
// 2 columns w/ horizontal alignment : 1366px and above