move the queuelistrefresh listener to the service, since it gets added multiple times if it's in the controller
This commit is contained in:
parent
6f0146e159
commit
5afe73a4b2
2 changed files with 6 additions and 6 deletions
|
@ -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) {
|
||||
|
|
|
@ -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 = [];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue