forked from Archives/Athou_commafeed
mark all as read
This commit is contained in:
@@ -152,9 +152,9 @@ module.controller('FeedListCtrl', function($scope, $routeParams, $http,
|
||||
entry : entry
|
||||
});
|
||||
EntryService.mark({
|
||||
_type : 'entry',
|
||||
_id : entry.id,
|
||||
_readtype : read
|
||||
type : 'entry',
|
||||
id : entry.id,
|
||||
read : read
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
@@ -89,7 +89,7 @@ module.directive('category', function($compile) {
|
||||
};
|
||||
});
|
||||
|
||||
module.directive('toolbar', function(SettingsService) {
|
||||
module.directive('toolbar', function($routeParams, $route, SettingsService, EntryService, SubscriptionService) {
|
||||
return {
|
||||
scope : {},
|
||||
restrict : 'E',
|
||||
@@ -99,6 +99,17 @@ module.directive('toolbar', function(SettingsService) {
|
||||
$scope.settings = SettingsService.settings;
|
||||
$scope.refresh = function() {
|
||||
$route.reload();
|
||||
},
|
||||
$scope.markAllAsRead = function() {
|
||||
EntryService.mark({
|
||||
type: $routeParams._type,
|
||||
id: $routeParams._id,
|
||||
read: true,
|
||||
}, function() {
|
||||
SubscriptionService.init(function() {
|
||||
$route.reload();
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
link : function($scope, element) {
|
||||
|
||||
@@ -41,9 +41,10 @@ module.factory('SubscriptionService', [ '$resource', '$http',
|
||||
s.flatCategories = {};
|
||||
|
||||
var res = $resource('rest/subscriptions/:_method', {}, actions);
|
||||
s.init = function() {
|
||||
s.subscriptions = res.get(function(){
|
||||
s.init = function(callback) {
|
||||
s.subscriptions = res.get(function(data) {
|
||||
s.flatCategories = flatten(s.subscriptions);
|
||||
callback(data);
|
||||
});
|
||||
};
|
||||
s.subscribe = function(sub, callback) {
|
||||
|
||||
Reference in New Issue
Block a user