Skip to content

Commit

Permalink
fix(uiGridHeader): Recalc all explicit heights
Browse files Browse the repository at this point in the history
Any time we are refreshing the canvas and headers have explicit heights,
we need to remove them and then recalculate as altered settings may change
the necessary height.

Fixes #3136
  • Loading branch information
c0bra committed Apr 28, 2015
1 parent 2cd2266 commit 43f63ac
Show file tree
Hide file tree
Showing 2 changed files with 140 additions and 128 deletions.
8 changes: 6 additions & 2 deletions src/js/core/directives/ui-grid-render-container.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,9 @@

var viewportHeight = rowContainer.getViewportHeight();

var headerViewportWidth = colContainer.getHeaderViewportWidth();
var footerViewportWidth = colContainer.getHeaderViewportWidth();
var headerViewportWidth,
footerViewportWidth;
headerViewportWidth = footerViewportWidth = colContainer.getHeaderViewportWidth();

// Set canvas dimensions
ret += '\n .grid' + uiGridCtrl.grid.id + ' .ui-grid-render-container-' + $scope.containerId + ' .ui-grid-canvas { width: ' + canvasWidth + 'px; height: ' + canvasHeight + 'px; }';
Expand All @@ -144,6 +145,9 @@
if (renderContainer.explicitHeaderCanvasHeight) {
ret += '\n .grid' + uiGridCtrl.grid.id + ' .ui-grid-render-container-' + $scope.containerId + ' .ui-grid-header-canvas { height: ' + renderContainer.explicitHeaderCanvasHeight + 'px; }';
}
else {
ret += '\n .grid' + uiGridCtrl.grid.id + ' .ui-grid-render-container-' + $scope.containerId + ' .ui-grid-header-canvas { height: inherit; }';
}

ret += '\n .grid' + uiGridCtrl.grid.id + ' .ui-grid-render-container-' + $scope.containerId + ' .ui-grid-viewport { width: ' + viewportWidth + 'px; height: ' + viewportHeight + 'px; }';
ret += '\n .grid' + uiGridCtrl.grid.id + ' .ui-grid-render-container-' + $scope.containerId + ' .ui-grid-header-viewport { width: ' + headerViewportWidth + 'px; }';
Expand Down
Loading

0 comments on commit 43f63ac

Please sign in to comment.