diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2016-01-21 22:35:24 +0100 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2016-01-21 22:35:24 +0100 |
commit | bcb9ca95518126131a16fcde894fc8765e7ab010 (patch) | |
tree | bc1e0e8a5b99ffbf8cd4165c6872fd4468f547bd /js/build/app.js | |
parent | 59daa89e4c82860d6b16b4e4bebab1eb8c302153 (diff) |
more explore
Diffstat (limited to 'js/build/app.js')
-rw-r--r-- | js/build/app.js | 61 |
1 files changed, 44 insertions, 17 deletions
diff --git a/js/build/app.js b/js/build/app.js index 9dd7e321a..e3c800890 100644 --- a/js/build/app.js +++ b/js/build/app.js @@ -533,23 +533,34 @@ app.controller('ContentController', }]); app.controller('ExploreController', ["sites", "$rootScope", "FeedResource", function (sites, $rootScope, FeedResource) { - 'use strict'; - - this.sites = sites; - - this.feedExists = function (location) { - return FeedResource.getByLocation(location) !== undefined; - }; - - this.subscribeTo = function (location) { - $rootScope.$broadcast('addFeed', location); - }; - - this.isCategoryShown = function (data) { - return data.filter(function (element) { - return FeedResource.getByLocation(element.feed) === undefined; - }).length > 0; - }; + 'use strict'; + + this.sites = sites; + // join all sites + this.feeds = Object.keys(sites).map(function (key) { + return [key, sites[key]]; + }).reduce(function (xs, x) { + var category = x[0]; + var feedList = x[1]; + feedList.forEach(function (feed) { + feed.category = category; + }); + return xs.concat(feedList); + }, []); + + this.feedExists = function (location) { + return FeedResource.getByLocation(location) !== undefined; + }; + + this.subscribeTo = function (location) { + $rootScope.$broadcast('addFeed', location); + }; + + this.isCategoryShown = function (data) { + return data.filter(function (element) { + return FeedResource.getByLocation(element.feed) === undefined; + }).length > 0; + }; }]); app.controller('NavigationController', @@ -2848,6 +2859,22 @@ app.directive('newsReadFile', function () { }); }; }); +app.directive('newsRefreshMasonry', function () { + 'use strict'; + return function (scope, elem) { + if (scope.$last) { + var $grid = elem.parent().masonry({ + itemSelector: '.explore-feed', + gutter: 25, + columnWidth: 300 + }); + + $grid.imagesLoaded().progress( function() { + $grid.masonry('layout'); + }); + } + }; +}); 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'; |