From 9859f7b262c286f689f1065885c9b0e44b940871 Mon Sep 17 00:00:00 2001 From: schneefux Date: Sun, 23 Oct 2016 19:05:55 +0200 Subject: use a library for image onload events --- themes/flog/layouts/partials/listing.html | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'themes/flog/layouts/partials/listing.html') diff --git a/themes/flog/layouts/partials/listing.html b/themes/flog/layouts/partials/listing.html index a5556b6..c652294 100644 --- a/themes/flog/layouts/partials/listing.html +++ b/themes/flog/layouts/partials/listing.html @@ -59,9 +59,7 @@ function loadMasonry() { if (typeof imageLoadAttached === 'undefined') { imageLoadAttached = true; - [].forEach.call(document.images, function(i) { - i.addEventListener('load', loadMasonry, false); - }); + imagesLoaded(document.body).on('always', loadMasonry) } if (typeof Masonry === 'undefined') { -- cgit v1.3.1