mirror of
https://github.com/TangentFoxy/memex.git
synced 2024-12-17 19:14:21 +00:00
Merge pull request #1 from dotcli/bugfix/masonry-layout-refresh.
BUGFIX: make masonry recalculate layout after image's loaded
This commit is contained in:
commit
a2f46b1281
@ -31,21 +31,21 @@ function ViewMasonry()
|
|||||||
fitWidth: true,
|
fitWidth: true,
|
||||||
transitionDuration: 0,
|
transitionDuration: 0,
|
||||||
});
|
});
|
||||||
console.log(3 + ' ' + this.msnry);
|
console.log(3);
|
||||||
|
|
||||||
// var imgLoad = imagesLoaded('.grid');
|
var imgLoad = imagesLoaded('.grid');
|
||||||
// function onAlways( instance ) {
|
function onAlways( instance ) {
|
||||||
// console.log('all images are loaded');
|
console.log('all images are loaded');
|
||||||
// parent.msnry.reloadItems();
|
this.msnry.layout();
|
||||||
// parent.msnry.layout();
|
console.log(this.msnry);
|
||||||
// }
|
}
|
||||||
// imgLoad.on( 'always', onAlways );
|
imgLoad.on( 'always', onAlways.bind(this) );
|
||||||
// // imgLoad.off( 'always', onAlways );
|
// imgLoad.off( 'always', onAlways );
|
||||||
// imgLoad.on( 'progress', function(instance, image)
|
imgLoad.on( 'progress', function(instance, image)
|
||||||
// {
|
{
|
||||||
// var result = image.isLoaded ? 'loaded' : 'broken';
|
var result = image.isLoaded ? 'loaded' : 'broken';
|
||||||
// console.log( 'image is ' + result + ' for ' + image.img.src );
|
console.log( 'image is ' + result + ' for ' + image.img.src );
|
||||||
// });
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user