save settings on read mode change

This commit is contained in:
Athou
2013-03-23 23:14:14 +01:00
parent f0ac0d1722
commit 0b1241ebf9
11 changed files with 91 additions and 36 deletions

View File

@@ -81,23 +81,26 @@ module.controller('CategoryTreeCtrl', function($scope, $routeParams, $location,
});
module.controller('FeedListCtrl', function($scope, $routeParams, $http,
EntryService) {
EntryService, SettingsService) {
$scope.selectedType = $routeParams._type;
$scope.selectedId = $routeParams._id;
$scope.readType = 'all';
$scope.settings = SettingsService.settings;
$scope.$watch('settings.readingMode', function() {
$scope.refreshList();
});
$scope.refreshList = function() {
$scope.entryList = EntryService.get({
_type : $scope.selectedType,
_id : $scope.selectedId,
_readtype : $scope.readType
});
if ($scope.settings.readingMode) {
$scope.entryList = EntryService.get({
_type : $scope.selectedType,
_id : $scope.selectedId,
_readtype : $scope.settings.readingMode
});
}
};
$scope.refreshList();
$scope.mark = function(entry, read) {
if (entry.read != read) {
entry.read = read;