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

View File

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