forked from Archives/Athou_commafeed
have a default value for the readingMode setting
This commit is contained in:
@@ -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,
|
||||||
|
|||||||
@@ -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);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user