Skip to content

Commit

Permalink
Fixes #49, accounts for the spans of the children aswell
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott Elwood committed Jun 10, 2013
1 parent 5eed5f5 commit c08902b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
11 changes: 8 additions & 3 deletions core/jquery.shapeshift.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -244,12 +244,17 @@
columns = minColumns
globals.columns = columns

# Columns cannot exceed children
# Columns cannot exceed children span
children_count = @parsedChildren.length
if columns > children_count
columns = 0
actual_columns = 0
for i in [0...@parsedChildren.length]
columns += @parsedChildren[i].colspan
colspan = @parsedChildren[i].colspan

if colspan + actual_columns <= columns
actual_columns += colspan

columns = actual_columns

# Calculate the child offset from the left
globals.child_offset = padding_x
Expand Down
10 changes: 7 additions & 3 deletions core/jquery.shapeshift.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit c08902b

Please sign in to comment.