summaryrefslogtreecommitdiffstats
path: root/js/directive
diff options
context:
space:
mode:
Diffstat (limited to 'js/directive')
-rw-r--r--js/directive/NewsRefreshMasonry.js19
1 files changed, 11 insertions, 8 deletions
diff --git a/js/directive/NewsRefreshMasonry.js b/js/directive/NewsRefreshMasonry.js
index b9303b40d..ce656ee41 100644
--- a/js/directive/NewsRefreshMasonry.js
+++ b/js/directive/NewsRefreshMasonry.js
@@ -7,19 +7,22 @@
* @author Bernhard Posselt <dev@bernhard-posselt.com>
* @copyright Bernhard Posselt 2014
*/
-app.directive('newsRefreshMasonry', function () {
+app.directive('newsRefreshMasonry', 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);
}
};
}); \ No newline at end of file