Skip to content

Commit 174f252

Browse files
committed
fix(uiGridUtil): getBorderSize() missing "width"
The correct property name to use is "borderWidth", not just "border". "border" works in Chrome but was breaking in Firefox. Also had to change .ui-grid-header's box-sizing to content-box so IE11 would include the border in height calcs. AND finally IE11 was returning fractional heights so Grid parseInt()s the returned values.
1 parent 97868e0 commit 174f252

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

src/js/core/factories/Grid.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -1525,7 +1525,7 @@ angular.module('ui.grid')
15251525
var oldHeaderHeight = container.headerHeight;
15261526
var headerHeight = gridUtil.outerElementHeight(container.header);
15271527

1528-
container.headerHeight = headerHeight;
1528+
container.headerHeight = parseInt(headerHeight, 10);
15291529

15301530
if (oldHeaderHeight !== headerHeight) {
15311531
rebuildStyles = true;
@@ -1534,7 +1534,9 @@ angular.module('ui.grid')
15341534
// Get the "inner" header height, that is the height minus the top and bottom borders, if present. We'll use it to make sure all the headers have a consistent height
15351535
var topBorder = gridUtil.getBorderSize(container.header, 'top');
15361536
var bottomBorder = gridUtil.getBorderSize(container.header, 'bottom');
1537-
var innerHeaderHeight = headerHeight - topBorder - bottomBorder;
1537+
var innerHeaderHeight = parseInt(headerHeight - topBorder - bottomBorder, 10);
1538+
1539+
innerHeaderHeight = innerHeaderHeight < 0 ? 0 : innerHeaderHeight;
15381540

15391541
container.innerHeaderHeight = innerHeaderHeight;
15401542

src/js/core/services/ui-grid-util.js

+2
Original file line numberDiff line numberDiff line change
@@ -757,6 +757,8 @@ module.service('gridUtil', ['$log', '$window', '$document', '$http', '$templateC
757757
borderType = 'border';
758758
}
759759

760+
borderType += 'Width';
761+
760762
var val = parseInt(styles[borderType], 10);
761763

762764
if (isNaN(val)) {

src/less/header.less

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
.ui-grid-header {
99
border-bottom: 1px solid @borderColor;
10+
box-sizing: content-box;;
1011
}
1112

1213
.ui-grid-top-panel {

0 commit comments

Comments
 (0)