This commit is contained in:
Athou
2013-05-17 13:31:43 +02:00
parent f5843e28b6
commit 62e851cacf
4 changed files with 46 additions and 13 deletions

View File

@@ -390,13 +390,31 @@ function($scope, $http, $state, $stateParams, $route, $location,
$scope.$emit('emitReload');
};
$scope.markAllAsRead = function() {
var markAll = function(olderThan) {
$scope.$emit('emitMarkAll', {
type : $stateParams._type,
id : $stateParams._id,
olderThan: olderThan,
read : true
});
};
$scope.markAllAsRead = function() {
markAll();
};
$scope.markAllDay = function() {
markAll(new Date().getTime() - 86400000);
};
$scope.markAllWeek = function() {
markAll(new Date().getTime() - 604800000);
};
$scope.markAllTwoWeeks = function() {
markAll(new Date().getTime() - 1209600000);
};
$scope.keywords = $stateParams._keywords;
$scope.search = function() {
@@ -531,12 +549,12 @@ function($scope, $stateParams, $http, $route, $window, EntryService, SettingsSer
}
};
$scope.markAll = function() {
$scope.markAll = function(olderThan) {
var service = $scope.selectedType == 'feed' ? FeedService
: CategoryService;
service.mark({
id : $scope.selectedId,
olderThan : $scope.timestamp,
olderThan : olderThan || $scope.timestamp,
read : true
}, function() {
CategoryService.init(function() {
@@ -714,7 +732,7 @@ function($scope, $stateParams, $http, $route, $window, EntryService, SettingsSer
});
$scope.$on('markAll', function(event, args) {
$scope.markAll();
$scope.markAll(args.olderThan);
});
$scope.$on('reload', function(event, args) {