Skip to content

Commit 98ed010

Browse files
committed
fix(uiGridHeader): Use parseInt on header heights
We were using parseInt but not in the right place, so browsers that use fractional pixel values were not allowing the header to shrink appropriately.
1 parent e2a9660 commit 98ed010

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

src/features/selection/test/uiGridSelectionDirective.spec.js

-2
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,6 @@ describe('ui.grid.selection uiGridSelectionDirective', function() {
8383
it("doesn't prevent headers from shrinking when filtering gets turned off", function () {
8484
// Header height with filtering on
8585
var filteringHeight = $(elm).find('.ui-grid-header').height();
86-
87-
dump(elm.controller('uiGrid').grid.api.core.notifyDataChange);
8886

8987
parentScope.options.enableFiltering = false;
9088
elm.controller('uiGrid').grid.api.core.notifyDataChange( uiGridConstants.dataChange.COLUMN );

src/js/core/factories/Grid.js

+2-6
Original file line numberDiff line numberDiff line change
@@ -1860,9 +1860,7 @@ angular.module('ui.grid')
18601860

18611861
if (container.header) {
18621862
var oldHeaderHeight = container.headerHeight;
1863-
var headerHeight = gridUtil.outerElementHeight(container.header);
1864-
1865-
container.headerHeight = parseInt(headerHeight, 10);
1863+
var headerHeight = container.headerHeight = parseInt(gridUtil.outerElementHeight(container.header), 10);
18661864

18671865
if (oldHeaderHeight !== headerHeight) {
18681866
rebuildStyles = true;
@@ -1886,9 +1884,7 @@ angular.module('ui.grid')
18861884

18871885
if (container.headerCanvas) {
18881886
var oldHeaderCanvasHeight = container.headerCanvasHeight;
1889-
var headerCanvasHeight = gridUtil.outerElementHeight(container.headerCanvas);
1890-
1891-
container.headerCanvasHeight = parseInt(headerCanvasHeight, 10);
1887+
var headerCanvasHeight = container.headerCanvasHeight = parseInt(gridUtil.outerElementHeight(container.headerCanvas), 10);
18921888

18931889
if (oldHeaderCanvasHeight !== headerCanvasHeight) {
18941890
rebuildStyles = true;

0 commit comments

Comments
 (0)