Permalink
Browse files

fixed a bug with hidden elastic columns

  • Loading branch information...
1 parent 2e5321f commit af2ed45343140d3951d7bda8b2079ebeccadbec5 @azendal committed Sep 7, 2010
Showing with 11 additions and 6 deletions.
  1. +11 −6 library/js/elastic.js
View
@@ -161,6 +161,10 @@ Elastic.processRow = function processRow(columns, containerWidth, fixedColumnsWi
var currentColumn, computedWidth, columnPosition, columnsWidth, lastColumn, i, j, l, elasticColumnWidths;
+ if(fixedColumnsWidth >= containerWidth){
+ return;
+ }
+
computedWidth = 0;
columnPosition = 0;
columnsWidth = fixedColumnsWidth;
@@ -184,12 +188,13 @@ Elastic.processRow = function processRow(columns, containerWidth, fixedColumnsWi
computedWidth = 0;
}
}
-
- for(i = 0, l = elasticColumns.length; i < l; i++) {
- elasticColumnWidths = Elastic.round(containerWidth - columnsWidth, elasticColumns.length);
- for(j = 0, l = elasticColumns.length; j < l; j++) {
- elasticColumns[j].style.width = elasticColumnWidths[j].width + 'px';
- }
+
+ if(elasticColumns.length > 0){
+ elasticColumnWidths = Elastic.round(containerWidth - columnsWidth, elasticColumns.length);
+
+ for(i = 0, l = elasticColumns.length; i < l; i++) {
+ elasticColumns[i].style.width = elasticColumnWidths[i].width + 'px';
+ }
}
if(lastColumn.isFinal) {

0 comments on commit af2ed45

Please sign in to comment.