allow ordering (fix #30)

This commit is contained in:
Athou
2013-04-10 10:28:48 +02:00
parent 1683a1ce50
commit ae4cd0b5e1
8 changed files with 107 additions and 50 deletions

View File

@@ -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);

View File

@@ -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>