have a default value for the readingMode setting

This commit is contained in:
Athou
2013-03-28 12:37:45 +01:00
committed by Athou
parent 6587f038fe
commit 40516cb146
2 changed files with 11 additions and 13 deletions

View File

@@ -104,15 +104,13 @@ module.controller('FeedListCtrl', function($scope, $routeParams, $http,
$scope.hasMore = true;
$scope.refreshList = function() {
if ($scope.settings.readingMode) {
$scope.entryList = EntryService.get({
type : $scope.selectedType,
id : $scope.selectedId,
readType : $scope.settings.readingMode,
offset : 0,
limit : 30
});
}
$scope.entryList = EntryService.get({
type : $scope.selectedType,
id : $scope.selectedId,
readType : $scope.settings.readingMode,
offset : 0,
limit : 30
});
};
$scope.loadMoreEntries = function() {
@@ -122,8 +120,6 @@ module.controller('FeedListCtrl', function($scope, $routeParams, $http,
return;
if ($scope.busy)
return;
if (!$scope.settings.readingMode)
return;
$scope.busy = true;
EntryService.get({
type : $scope.selectedType,

View File

@@ -118,8 +118,10 @@ module.factory('EntryService', [ '$resource', '$http',
module.service('SettingsService', function($resource) {
var s = {}
s.settings = {};
s.settings.readMode = 'unread';
s.settings = $resource('rest/settings/get').get();
s.settings.readingMode = 'unread';
$resource('rest/settings/get').get(function(data) {
s.settings.readingMode = data.readingMode;
});
s.save = function() {
$resource('rest/settings/save').save(s.settings);
};