From 71269582fa0d07ff91ad80a04e39428ff735748f Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Wed, 19 Nov 2014 16:43:14 +0100 Subject: allow to add feeds from recommended sites --- js/build/app.js | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) (limited to 'js/build/app.js') 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) { -- cgit v1.2.3