mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
auto refresh every 30s (fixes #6)
This commit is contained in:
@@ -10,7 +10,7 @@ module.run(function($rootScope) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
module.controller('CategoryTreeCtrl', function($scope, $stateParams, $location,
|
module.controller('CategoryTreeCtrl', function($scope, $timeout, $stateParams, $location,
|
||||||
$state, $route, SubscriptionService) {
|
$state, $route, SubscriptionService) {
|
||||||
|
|
||||||
$scope.$on('$stateChangeSuccess', function() {
|
$scope.$on('$stateChangeSuccess', function() {
|
||||||
@@ -18,6 +18,12 @@ module.controller('CategoryTreeCtrl', function($scope, $stateParams, $location,
|
|||||||
$scope.selectedId = $stateParams._id;
|
$scope.selectedId = $stateParams._id;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$timeout(function refreshTree() {
|
||||||
|
SubscriptionService.init(function() {
|
||||||
|
$timeout(refreshTree, 30000);
|
||||||
|
});
|
||||||
|
}, 30000);
|
||||||
|
|
||||||
$scope.SubscriptionService = SubscriptionService;
|
$scope.SubscriptionService = SubscriptionService;
|
||||||
|
|
||||||
var unreadCount = function(category) {
|
var unreadCount = function(category) {
|
||||||
@@ -253,8 +259,8 @@ module.controller('FeedListCtrl', function($scope, $stateParams, $http, $route,
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
module.controller('ManageUsersCtrl',
|
module.controller('ManageUsersCtrl', function($scope, $state, $location,
|
||||||
function($scope, $state, $location, AdminUsersService) {
|
AdminUsersService) {
|
||||||
$scope.users = AdminUsersService.getAll();
|
$scope.users = AdminUsersService.getAll();
|
||||||
$scope.selection = [];
|
$scope.selection = [];
|
||||||
$scope.gridOptions = {
|
$scope.gridOptions = {
|
||||||
@@ -280,7 +286,9 @@ module.controller('ManageUserCtrl', function($scope, $state, $stateParams,
|
|||||||
AdminUsersService) {
|
AdminUsersService) {
|
||||||
$scope.user = $stateParams._id ? AdminUsersService.get({
|
$scope.user = $stateParams._id ? AdminUsersService.get({
|
||||||
id : $stateParams._id
|
id : $stateParams._id
|
||||||
}) : {enabled: true};
|
}) : {
|
||||||
|
enabled : true
|
||||||
|
};
|
||||||
$scope.alerts = [];
|
$scope.alerts = [];
|
||||||
$scope.closeAlert = function(index) {
|
$scope.closeAlert = function(index) {
|
||||||
$scope.alerts.splice(index, 1);
|
$scope.alerts.splice(index, 1);
|
||||||
@@ -302,7 +310,9 @@ module.controller('ManageUserCtrl', function($scope, $state, $stateParams,
|
|||||||
}, alertFunction);
|
}, alertFunction);
|
||||||
};
|
};
|
||||||
$scope.remove = function() {
|
$scope.remove = function() {
|
||||||
AdminUsersService.remove({id: $scope.user.id}, function() {
|
AdminUsersService.remove({
|
||||||
|
id : $scope.user.id
|
||||||
|
}, function() {
|
||||||
$state.transitionTo('admin.userlist');
|
$state.transitionTo('admin.userlist');
|
||||||
}, alertFunction);
|
}, alertFunction);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user