diff --git a/js/controllers.js b/js/controllers.js index d1f0719..e236929 100644 --- a/js/controllers.js +++ b/js/controllers.js @@ -92,13 +92,9 @@ function ListItemCtrl($scope, $rootScope, feedItems, downloader, pageChanger) }; } -function QueueListCtrl($scope, $rootScope, pageSwitcher, feedItems, feeds, downloader, queueList, pageChanger) { +function QueueListCtrl($scope, pageSwitcher, feedItems, feeds, queueList) { $scope.queue = queueList.getQueueList(); - $scope.$on('queueListRefresh', function(event) { - $rootScope.$apply(queueList.rebuildList()); - }); - $scope.downloadItems = function(updateStatus) { feeds.downloadAllItems(feedItems, function(feedItem, feed) { if (feedItem) { diff --git a/js/queueList.js b/js/queueList.js index 9838b6c..816d795 100644 --- a/js/queueList.js +++ b/js/queueList.js @@ -1,6 +1,10 @@ angular.module('podcasts.queueList', ['podcasts.database']) - .run(['queueList', function(queueList) { + .run(['queueList', '$rootScope', function(queueList, $rootScope) { queueList.rebuildList(); + + $rootScope.$on('queueListRefresh', function(event) { + $rootScope.$apply(queueList.rebuildList()); + }); }]) .service('queueList', ['db', '$rootScope', function(db, $rootScope) { var queueList = [];