Skip to content

Commit

Permalink
#7338 fix TableDisplay resize feature
Browse files Browse the repository at this point in the history
  • Loading branch information
Mariusz Jurowicz committed Jul 9, 2018
1 parent 5fbda08 commit f281ede
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions js/notebook/src/tableDisplay/dataGrid/DataGridResize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export class DataGridResize {
this.handleMouseMove = this.handleMouseMove.bind(this);
this.handleMouseUp = this.handleMouseUp.bind(this);
this.fillEmptySpaceResizeFn = this.fillEmptySpaceResizeFn.bind(this);
this.fitVieport = throttle<void, void>(this.fitVieport, 150, this);
this.fitVieport = throttle<void, void>(this.fitVieport, 100, this);

this.installMessageHook();
}
Expand Down Expand Up @@ -96,7 +96,7 @@ export class DataGridResize {
return;
}

this.dataGrid.node.style.width = `${width + 1}px`;
this.dataGrid.node.style.width = `${width}px`;
this.fitVieport();
}

Expand All @@ -123,6 +123,8 @@ export class DataGridResize {

this.dataGrid.columnSections['_sections'].forEach(this.fillEmptySpaceResizeFn('body', value));
this.dataGrid.rowHeaderSections['_sections'].forEach(this.fillEmptySpaceResizeFn('row-header', value));

this.fitVieport();
}

updateColumnWidth(region: ColumnRegion): Function {
Expand Down Expand Up @@ -151,7 +153,6 @@ export class DataGridResize {

stopResizing() {
this.resizing = false;

this.resizeMode = null;
this.dataGrid.node.parentElement.removeEventListener('mouseup', this.handleMouseUp, true);
document.body.removeEventListener('mousemove', this.handleMouseMove, true);
Expand Down

0 comments on commit f281ede

Please sign in to comment.