diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2016-10-23 19:05:55 +0200 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2016-10-23 19:05:55 +0200 |
| commit | 9859f7b262c286f689f1065885c9b0e44b940871 (patch) | |
| tree | 6d8bac6e6be4506ea1c0a5fcc5a423e79d99de44 /themes/flog/layouts | |
| parent | 852c45a1f50304cade98b4afeee15ec1fdc81268 (diff) | |
| download | pragblog-9859f7b262c286f689f1065885c9b0e44b940871.tar.gz pragblog-9859f7b262c286f689f1065885c9b0e44b940871.zip | |
use a library for image onload events
Diffstat (limited to 'themes/flog/layouts')
| -rw-r--r-- | themes/flog/layouts/partials/footer.html | 1 | ||||
| -rw-r--r-- | themes/flog/layouts/partials/listing.html | 4 |
2 files changed, 2 insertions, 3 deletions
diff --git a/themes/flog/layouts/partials/footer.html b/themes/flog/layouts/partials/footer.html index 0dcd9e1..5d4ac07 100644 --- a/themes/flog/layouts/partials/footer.html +++ b/themes/flog/layouts/partials/footer.html @@ -3,6 +3,7 @@ <script type="text/javascript" src="/js/jquery-2.2.4.min.js"></script> <script type="text/javascript" src="/js/materialize-0.97.7.min.js"></script> <script type="text/javascript" src="/js/smoothstate-0.5.2.min.js"></script> + <script type="text/javascript" src="/js/imagesloaded-4.1.1.min.js"></script> <script type="text/javascript"> document.addEventListener('pageReady', function() { $('.button-collapse').sideNav(); 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') { |
