Skip to content

Commit 33b4d6d

Browse files
fix(grid): adjust grid height when initial height is equal to row height
1 parent aa7ab65 commit 33b4d6d

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/js/core/directives/ui-grid.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@
4444
deregFunctions.push( $scope.$parent.$watch($scope.uiGrid.data, dataWatchFunction) );
4545
deregFunctions.push( $scope.$parent.$watch(function() {
4646
if ( self.grid.appScope[$scope.uiGrid.data] ){
47-
return self.grid.appScope[$scope.uiGrid.data].length;
47+
return self.grid.appScope[$scope.uiGrid.data].length;
4848
} else {
4949
return undefined;
50-
}
50+
}
5151
}, dataWatchFunction) );
5252
} else {
5353
deregFunctions.push( $scope.$parent.$watch(function() { return $scope.uiGrid.data; }, dataWatchFunction) );
@@ -63,7 +63,7 @@
6363
}
6464
deregFunctions.push( $scope.$parent.$watchCollection(function() { return $scope.uiGrid.columnDefs; }, columnDefsWatchFunction) );
6565
}
66-
66+
6767

6868
function columnDefsWatchFunction(n, o) {
6969
if (n && n !== o) {
@@ -81,15 +81,15 @@
8181
function dataWatchFunction(newData) {
8282
// gridUtil.logDebug('dataWatch fired');
8383
var promises = [];
84-
84+
8585
if ( self.grid.options.fastWatch ){
8686
if (angular.isString($scope.uiGrid.data)) {
8787
newData = self.grid.appScope[$scope.uiGrid.data];
8888
} else {
8989
newData = $scope.uiGrid.data;
9090
}
9191
}
92-
92+
9393
if (newData) {
9494
// columns length is greater than the number of row header columns, which don't count because they're created automatically
9595
var hasColumns = self.grid.columns.length > (self.grid.rowHeaderColumns ? self.grid.rowHeaderColumns.length : 0);
@@ -277,7 +277,7 @@ function uiGridDirective($compile, $templateCache, $timeout, $window, gridUtil,
277277
grid.gridHeight = $scope.gridHeight = gridUtil.elementHeight($elm);
278278

279279
// If the grid isn't tall enough to fit a single row, it's kind of useless. Resize it to fit a minimum number of rows
280-
if (grid.gridHeight < grid.options.rowHeight && grid.options.enableMinHeightCheck) {
280+
if (grid.gridHeight <= grid.options.rowHeight && grid.options.enableMinHeightCheck) {
281281
autoAdjustHeight();
282282
}
283283

@@ -291,7 +291,7 @@ function uiGridDirective($compile, $templateCache, $timeout, $window, gridUtil,
291291
var contentHeight = grid.options.minRowsToShow * grid.options.rowHeight;
292292
var headerHeight = grid.options.showHeader ? grid.options.headerRowHeight : 0;
293293
var footerHeight = grid.calcFooterHeight();
294-
294+
295295
var scrollbarHeight = 0;
296296
if (grid.options.enableHorizontalScrollbar === uiGridConstants.scrollbars.ALWAYS) {
297297
scrollbarHeight = gridUtil.getScrollbarWidth();

0 commit comments

Comments
 (0)