forked from Archives/Athou_commafeed
allow ordering (fix #30)
This commit is contained in:
@@ -214,6 +214,12 @@ module.controller('ToolbarCtrl', function($scope, $http, $state, $stateParams,
|
||||
SettingsService.save();
|
||||
}
|
||||
});
|
||||
$scope.$watch('settingsService.settings.readingOrder', function(newValue,
|
||||
oldValue) {
|
||||
if (newValue && oldValue && newValue != oldValue) {
|
||||
SettingsService.save();
|
||||
}
|
||||
});
|
||||
$scope.refresh = function() {
|
||||
$scope.$emit('emitReload');
|
||||
};
|
||||
@@ -267,6 +273,12 @@ module.controller('FeedListCtrl', function($scope, $stateParams, $http, $route,
|
||||
$scope.$emit('emitReload');
|
||||
}
|
||||
});
|
||||
$scope.$watch('settingsService.settings.readingOrder', function(newValue,
|
||||
oldValue) {
|
||||
if (newValue && oldValue && newValue != oldValue) {
|
||||
$scope.$emit('emitReload');
|
||||
}
|
||||
});
|
||||
|
||||
$scope.limit = 10;
|
||||
$scope.busy = false;
|
||||
@@ -302,6 +314,7 @@ module.controller('FeedListCtrl', function($scope, $stateParams, $http, $route,
|
||||
type : $scope.selectedType,
|
||||
id : $scope.selectedId,
|
||||
readType : $scope.settingsService.settings.readingMode,
|
||||
order : $scope.settingsService.settings.readingOrder,
|
||||
offset : $scope.entries.length,
|
||||
limit : limit
|
||||
}, callback);
|
||||
|
||||
@@ -5,6 +5,10 @@
|
||||
<button type="button" class="btn" ng-model="settingsService.settings.readingMode" btn-radio="'unread'">Unread</button>
|
||||
<button type="button" class="btn" ng-model="settingsService.settings.readingMode" btn-radio="'all'">All</button>
|
||||
</div>
|
||||
<div class="btn-group" data-toggle="buttons-radio">
|
||||
<button type="button" class="btn" ng-model="settingsService.settings.readingOrder" btn-radio="'desc'">Newest</button>
|
||||
<button type="button" class="btn" ng-model="settingsService.settings.readingOrder" btn-radio="'asc'">Oldest</button>
|
||||
</div>
|
||||
|
||||
<button type="button" class="btn" ng-click="refresh()"><i class="icon-refresh"></i> Refresh</button>
|
||||
<button type="button" class="btn" ng-click="markAllAsRead()"><i class="icon-ok"></i> Mark all as read</button>
|
||||
|
||||
Reference in New Issue
Block a user