Permalink
Browse files

fix bug on combination of span computing bigger number of columns tha…

…n the numer of columns per row
  • Loading branch information...
1 parent 53000c9 commit 0e03e50f99e806ec22b08e03f76be93b62f5e525 @azendal committed Jul 22, 2011
Showing with 26 additions and 6 deletions.
  1. +26 −6 library/js/elastic.js
View
@@ -132,13 +132,33 @@ Elastic.columnsIterator = function columnsElementsIteration(columnsElement) {
nextColumnsOnRow = columnsOnRow + currentColumn.spanWidth;
if (nextColumnsOnRow >= columnsPerRow || currentColumn === lastColumn || currentColumn.isFinal) {
- rowColumns.push(currentColumn);
+ if (nextColumnsOnRow <= columnsPerRow) {
+ rowColumns.push(currentColumn);
+ }
Elastic.processRow(rowColumns, containerWidth, fixedColumnsWidth, elasticColumns, columnWidths);
- fixedColumnsWidth = 0;
- columnsOnRow = 0;
- nextColumnsOnRow = 0;
- elasticColumns = [];
- rowColumns = [];
+
+ if (nextColumnsOnRow > columnsPerRow) {
+ if(currentColumn.isFixed){
+ fixedColumnsWidth = fixedColumnWidth;
+ }
+ columnsOnRow = currentColumn.spanWidth;
+ nextColumnsOnRow = currentColumn.spanWidth;
+ if(currentColumn.isElastic){
+ elasticColumns = [currentColumn];
+ }
+ rowColumns = [currentColumn];
+
+ if(currentColumn === lastColumn){
+ Elastic.processRow(rowColumns, containerWidth, fixedColumnsWidth, elasticColumns, columnWidths);
+ }
+ }
+ else {
+ fixedColumnsWidth = 0;
+ columnsOnRow = 0;
+ nextColumnsOnRow = 0;
+ elasticColumns = [];
+ rowColumns = [];
+ }
continue;
}

0 comments on commit 0e03e50

Please sign in to comment.