diff options
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) { |