Permalink
Browse files

src : imagesLoaded : call callback on self

  • Loading branch information...
1 parent 244c303 commit 6c1fb787440d80eb6f53e02239cb6513fa55c843 @desandro desandro committed Jul 22, 2011
Showing with 3 additions and 3 deletions.
  1. +2 −2 jquery.masonry.js
  2. +1 −1 jquery.masonry.min.js
View
@@ -392,9 +392,9 @@
$.fn.imagesLoaded = function( callback ){
var elems = this.find( 'img' ),
elems_src = [],
+ self = this,
len = elems.length;
-
if ( !elems.length ) {
callback.call( this );
return this;
@@ -406,7 +406,7 @@
len = elems.length;
elems.one( 'load error', function() {
if ( --len === 0 ) {
- callback.call( elems, this );
+ callback.call( self );
}
}).each(function() {
this.src = elems_src.shift();
View

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

Oops, something went wrong.

0 comments on commit 6c1fb78

Please sign in to comment.