From c68ea392e84700dbccf923fff2cf62a1ff84a08e Mon Sep 17 00:00:00 2001 From: Changbai Li Date: Wed, 18 Jul 2018 18:06:05 +0800 Subject: [PATCH] BUGFIX: make masonry recalculate layout after image's loaded --- logic/viewmasonry.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/logic/viewmasonry.js b/logic/viewmasonry.js index 79b66cd..5b3cf9d 100644 --- a/logic/viewmasonry.js +++ b/logic/viewmasonry.js @@ -35,10 +35,10 @@ function ViewMasonry() var imgLoad = imagesLoaded('.grid'); function onAlways( instance ) { console.log('all images are loaded'); - //this.msnry.layout(); + this.msnry.layout(); console.log(this.msnry); } - imgLoad.on( 'always', onAlways ); + imgLoad.on( 'always', onAlways.bind(this) ); // imgLoad.off( 'always', onAlways ); imgLoad.on( 'progress', function(instance, image) {