Skip to content

Commit

Permalink
fix(core): use allowFloatWidth property to allow float calculations f…
Browse files Browse the repository at this point in the history
…or width
  • Loading branch information
marc-khoury-kronos authored and mportuga committed Jun 9, 2021
1 parent f4d3e22 commit bb28b2f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/core/src/js/factories/GridRenderContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,7 @@ angular.module('ui.grid')

if (angular.isNumber(column.width)) {
// pixel width, set to this value
if(column.colDef.allowFloatWidth) {
if (column.colDef.allowFloatWidth) {
width = parseFloat(column.width);
} else {
width = parseInt(column.width, 10);
Expand All @@ -620,7 +620,7 @@ angular.module('ui.grid')
// percentage width, set to percentage of the viewport
// round down to int - some browsers don't play nice with float maxWidth
var percentageIntegerValue = parseInt(column.width.replace(/%/g, ''), 10);
if(column.colDef.allowFloatWidth) {
if (column.colDef.allowFloatWidth) {
width = parseFloat(percentageIntegerValue / 100 * availableWidth);
} else {
width = parseInt(percentageIntegerValue / 100 * availableWidth, 10);
Expand Down Expand Up @@ -657,7 +657,7 @@ angular.module('ui.grid')
asterisksArray.forEach(function (column) {
var width = parseInt(column.width.length * asteriskVal, 10);

if(column.colDef.allowFloatWidth) {
if (column.colDef.allowFloatWidth) {
width = parseFloat(column.width.length * asteriskVal);
}

Expand Down

0 comments on commit bb28b2f

Please sign in to comment.