forked from Archives/Athou_commafeed
toggle between unread and all entries
This commit is contained in:
@@ -86,12 +86,18 @@ module.controller('FeedListCtrl', function($scope, $routeParams, $http,
|
||||
$scope.selectedType = $routeParams._type;
|
||||
$scope.selectedId = $routeParams._id;
|
||||
|
||||
$scope.entryList = EntryService.get({
|
||||
_type : $scope.selectedType,
|
||||
_id : $scope.selectedId,
|
||||
_readtype : 'unread'
|
||||
})
|
||||
$scope.readType = 'all';
|
||||
|
||||
$scope.refreshList = function() {
|
||||
$scope.entryList = EntryService.get({
|
||||
_type : $scope.selectedType,
|
||||
_id : $scope.selectedId,
|
||||
_readtype : $scope.readType
|
||||
});
|
||||
};
|
||||
|
||||
$scope.refreshList();
|
||||
|
||||
$scope.mark = function(entry, read) {
|
||||
if (entry.read != read) {
|
||||
entry.read = read;
|
||||
|
||||
@@ -1,4 +1,14 @@
|
||||
<div ng-controller="FeedListCtrl">
|
||||
|
||||
|
||||
<div class="toolbar">
|
||||
<div class="btn-group" data-toggle="buttons-radio">
|
||||
<button type="button" class="btn" ng-model="readType" btn-radio="'all'" ng-click="refreshList()">All</button>
|
||||
<button type="button" class="btn" ng-model="readType" btn-radio="'unread'" ng-click="refreshList()">Unread only</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<span>{{entryList.name}}</span><span
|
||||
ng-show="selectedType == 'category'"> »</span>
|
||||
<div class="accordion" id="feed-accordion">
|
||||
|
||||
Reference in New Issue
Block a user