Skip to content

Commit

Permalink
allow empty list at init/update (thanks @JSteunou)
Browse files Browse the repository at this point in the history
  • Loading branch information
callmecavs committed May 8, 2016
1 parent 93f05cb commit 6b80ff5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions dist/bricks.min.js

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bricks.js",
"version": "1.2.0",
"version": "1.2.1",
"description": "A blazing fast masonry layout generator for fixed width elements.",
"homepage": "https://github.com/callmecavs/bricks.js",
"main": "dist/bricks.min.js",
Expand Down
4 changes: 4 additions & 0 deletions src/bricks.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ export default (options = {}) => {
}

function setNodesDimensions() {
if(nodes.length === 0) {
return
}

nodesWidth = nodes[0].clientWidth
nodesHeights = nodes.map(element => element.clientHeight)
}
Expand Down

0 comments on commit 6b80ff5

Please sign in to comment.