Hello. First of all, great module. My issue arose from a website with google fonts loaded via the font-face module. Masonry would load right after the images were loaded but before web fonts were loaded. This caused unseemly gaps in the display. I fixed this by altering the script to use $(window).load() instead of imagesLoaded. Is there any reason as to why masonry is executed on imagesLoaded?

Comments

waltf’s picture

Hi, i have the same issue, and changed the masonry_views.module file to :
// Initialize Masonry
$script = '(function ($) {
var $container = $(".' . $view_class . ' .view-content");
$(window).load(function(){
$container.masonry({
itemSelector: ".masonry-item",

but masonry is still active before the font loads.
Could you tell me what you changed?

Anonymous’s picture

Category: bug » support
Status: Active » Fixed

This may help: http://masonry.desandro.com/docs/help.html#fontface_fonts

The upcoming Masonry v2.x will allow you to choose whether or not to use the imagesLoaded feature, and will also allow you to override the Masonry javascript file to use your own custom configuration.

waltf’s picture

Thanks for all the hard work BWPanda, really appreciated.
I still couldn't get it working. Should i be changing modules/masonry/masonry_views/masonry_views.module file or another one?

I tried v2 but it didnt seem to work in views, so i reverted back to v1.
Thanks.

Anonymous’s picture

Views integration for Masonry v2 is still in progress, keep an eye on https://drupal.org/project/masonry_views

waltf’s picture

Thx, I will, already bookmarked. If someone found a solution for getting google fonts to load before applying masonry in v1, I would be very greatful, the $(window).load(function(){ solution in views isnt working for me.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.