Skip to content

Commit

Permalink
v1.1.3 Bug Fix, check for $bricks before arranging
Browse files Browse the repository at this point in the history
  • Loading branch information
desandro committed May 21, 2010
1 parent 0083872 commit a20e6cc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
15 changes: 8 additions & 7 deletions js/jquery.masonry.js
@@ -1,5 +1,5 @@
/*************************************************
** jQuery Masonry version 1.1.2
** jQuery Masonry version 1.1.3
** copyright David DeSandro, licensed GPL & MIT
** http://desandro.com/resources/jquery-masonry
**************************************************/
Expand Down Expand Up @@ -76,10 +76,6 @@


function masonrySetup($wall, opts, props) {
props.$bricks = opts.itemSelector == undefined ?
opts.$brickParent.children() :
opts.$brickParent.find(opts.itemSelector);

if ( opts.columnWidth == undefined) {
props.colW = props.masoned ?
$wall.data('masonry').colW :
Expand Down Expand Up @@ -216,7 +212,6 @@
// checks if masonry has been called before on this object
props.masoned = $wall.data('masonry') != undefined;


var previousOptions = props.masoned ? $wall.data('masonry').options : {};

var opts = $.extend(
Expand All @@ -232,14 +227,20 @@
//picked up from Paul Irish
callback = callback || function(){};


if ( props.masoned && opts.appendedContent != undefined ) {
// if we're dealing with appendedContent
opts.$brickParent = opts.appendedContent;
} else {
opts.$brickParent = $wall;
}

if ( opts.$brickParent.children().length > 0 ) {

props.$bricks = opts.itemSelector == undefined ?
opts.$brickParent.children() :
opts.$brickParent.find(opts.itemSelector);

if ( props.$bricks.length ) {
// call masonry layout
masonrySetup($wall, opts, props);
masonryArrange($wall, opts, props);
Expand Down
4 changes: 2 additions & 2 deletions js/jquery.masonry.min.js

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

0 comments on commit a20e6cc

Please sign in to comment.