diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2016-01-21 23:10:29 +0100 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2016-01-21 23:10:29 +0100 |
commit | a4400a11386da5317f2b673fbe78f7ec6fca0c31 (patch) | |
tree | 90b0b45ed88a0358b912f9f7cf0b54e4ac93a4fd /js/build/app.js | |
parent | bcb9ca95518126131a16fcde894fc8765e7ab010 (diff) |
fix grid
Diffstat (limited to 'js/build/app.js')
-rw-r--r-- | js/build/app.js | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/js/build/app.js b/js/build/app.js index e3c800890..463c1e582 100644 --- a/js/build/app.js +++ b/js/build/app.js @@ -2859,22 +2859,25 @@ app.directive('newsReadFile', function () { }); }; }); -app.directive('newsRefreshMasonry', function () { +app.directive('newsRefreshMasonry', ["$timeout", function ($timeout) { 'use strict'; - return function (scope, elem) { - if (scope.$last) { - var $grid = elem.parent().masonry({ - itemSelector: '.explore-feed', + var refresh = function (elem) { + $timeout(function () { + elem.parent().masonry({ + itemSelector: '.grid-item', gutter: 25, columnWidth: 300 }); + console.log('fresh'); + }); + }; - $grid.imagesLoaded().progress( function() { - $grid.masonry('layout'); - }); + return function (scope, elem) { + if (scope.$last) { + refresh(elem); } }; -}); +}]); app.directive('newsScroll', ["$timeout", "ITEM_AUTO_PAGE_SIZE", "MARK_READ_TIMEOUT", "SCROLL_TIMEOUT", function ($timeout, ITEM_AUTO_PAGE_SIZE, MARK_READ_TIMEOUT, SCROLL_TIMEOUT) { 'use strict'; |