diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-11-19 16:43:14 +0100 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-11-19 16:43:14 +0100 |
commit | 71269582fa0d07ff91ad80a04e39428ff735748f (patch) | |
tree | bbee92d6ca1d29017ed89b9a62ba1b22135c531f /js/build/app.js | |
parent | 5658386300d4315065484cea3517f9cea87bff0f (diff) |
allow to add feeds from recommended sites
Diffstat (limited to 'js/build/app.js')
-rw-r--r-- | js/build/app.js | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/js/build/app.js b/js/build/app.js index 0c8d62195..153457e7a 100644 --- a/js/build/app.js +++ b/js/build/app.js @@ -388,11 +388,16 @@ app.controller('ContentController', }; }]); -app.controller('ExploreController', ["sites", function (sites) { +app.controller('ExploreController', ["sites", "$rootScope", function (sites, $rootScope) { 'use strict'; this.sites = sites.data; + + this.subscribeTo = function (url) { + $rootScope.$broadcast('addFeed', url); + }; + }]); app.controller('NavigationController', ["$route", "FEED_TYPE", "FeedResource", "FolderResource", "ItemResource", "SettingsResource", "Publisher", "$rootScope", "$location", "$q", function ($route, FEED_TYPE, FeedResource, FolderResource, ItemResource, @@ -2215,6 +2220,29 @@ app.directive('appNavigationEntryUtils', function () { } }; }); +app.directive('newsAddFeed', ["$rootScope", "$timeout", function ($rootScope, $timeout) { + 'use strict'; + + return { + restrict: 'A', + link: function (scope, elem) { + $rootScope.$on('addFeed', function (_, url) { + + $timeout(function () { + if (elem.is(':animated')) { + elem.stop(true, true); + elem.show(); + } else if (!elem.is(':visible')) { + elem.slideDown(); + } + elem.find('[ng-model="Navigation.feed.url"]').focus(); + }); + + scope.Navigation.feed.url = url; + }); + } + }; +}]); app.directive('newsAutoFocus', ["$timeout", function ($timeout) { 'use strict'; return function (scope, elem, attrs) { |