Permalink
Browse files

v1.1.3 Bug Fix, check for $bricks before arranging

  • Loading branch information...
1 parent 0083872 commit a20e6ccf259aff3b79fa8d5f92f9583fe6314dc8 @desandro desandro committed May 21, 2010
Showing with 10 additions and 9 deletions.
  1. +8 −7 js/jquery.masonry.js
  2. +2 −2 js/jquery.masonry.min.js
View
@@ -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
**************************************************/
@@ -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 :
@@ -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(
@@ -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);
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

0 comments on commit a20e6cc

Please sign in to comment.