Handle resize message in Agent dashboard tab (#1908)

* Resize related changes WIP

* Resize table control better on resize

* Update DashboardTab to use inherited Disposable

* Set forceFitColumns to false
This commit is contained in:
Karl Burtram
2018-07-11 13:50:58 -07:00
committed by GitHub
parent cbce1f7008
commit 3e200b7f0f
14 changed files with 96 additions and 64 deletions

View File

@@ -5,8 +5,9 @@
import { Component, Input, ContentChild, OnDestroy, TemplateRef, ChangeDetectorRef, forwardRef, Inject } from '@angular/core';
import { Action } from 'vs/base/common/actions';
import { Disposable } from 'vs/base/common/lifecycle';
export abstract class TabChild {
export abstract class TabChild extends Disposable {
public abstract layout(): void;
}
@@ -19,7 +20,7 @@ export abstract class TabChild {
`
})
export class TabComponent implements OnDestroy {
@ContentChild(TabChild) private _child: TabChild;
private _child: TabChild;
@ContentChild(TemplateRef) templateRef;
@Input() public title: string;
@Input() public canClose: boolean;
@@ -31,6 +32,14 @@ export class TabComponent implements OnDestroy {
private rendered = false;
private destroyed: boolean = false;
@ContentChild(TabChild) private set child(tab: TabChild) {
this._child = tab;
if (this.active && this._child) {
this._child.layout();
}
}
constructor(
@Inject(forwardRef(() => ChangeDetectorRef)) private _cd: ChangeDetectorRef
) { }
@@ -78,6 +87,8 @@ export class TabComponent implements OnDestroy {
}
public layout() {
this._child.layout();
if (this._child) {
this._child.layout();
}
}
}