fix grid resizing interation with editor (#2427)

This commit is contained in:
Anthony Dresser
2018-09-05 17:32:58 -07:00
committed by GitHub
parent 534bbe9b9a
commit f147d799e0
7 changed files with 109 additions and 51 deletions

View File

@@ -97,6 +97,7 @@ export class GridPanel extends ViewletPanel {
private tables: GridTable<any>[] = [];
private tableDisposable: IDisposable[] = [];
private queryRunnerDisposables: IDisposable[] = [];
private currentHeight: number;
private runner: QueryRunner;
@@ -123,6 +124,11 @@ export class GridPanel extends ViewletPanel {
protected layoutBody(size: number): void {
this.splitView.layout(size);
// if the size hasn't change it won't layout our table so we have to do it manually
if (size === this.currentHeight) {
this.tables.map(e => e.layout());
}
this.currentHeight = size;
}
public set queryRunner(runner: QueryRunner) {
@@ -229,6 +235,7 @@ class GridTable<T> extends Disposable implements IView {
private container = document.createElement('div');
private selectionModel = new CellSelectionModel();
private styles: ITableStyles;
private currentHeight: number;
private columns: Slick.Column<T>[];
@@ -349,10 +356,15 @@ class GridTable<T> extends Disposable implements IView {
}
}
public layout(size: number): void {
public layout(size?: number): void {
if (!this.table) {
this.build();
}
if (!size) {
size = this.currentHeight;
} else {
this.currentHeight = size;
}
this.table.layout(
new Dimension(
getContentWidth(this.container) - ACTIONBAR_WIDTH,