notifications: always show all notifications

This commit is contained in:
Girish Ramakrishnan
2021-05-29 16:18:03 -07:00
parent e001a21e4b
commit 042d6099c4
2 changed files with 21 additions and 2 deletions
+15 -1
View File
@@ -9,9 +9,11 @@ angular.module('Application').controller('NotificationsController', ['$scope', '
$scope.notifications = [];
$scope.activeNotification = null;
$scope.busy = true;
$scope.currentPage = 1;
$scope.perPage = 20;
$scope.refresh = function () {
Client.getNotifications({}, 1, 100, function (error, result) {
Client.getNotifications({}, $scope.currentPage, $scope.perPage, function (error, result) {
if (error) return console.error(error);
// collapse by default
@@ -30,6 +32,18 @@ angular.module('Application').controller('NotificationsController', ['$scope', '
});
};
$scope.showNextPage = function () {
$scope.currentPage++;
$scope.refresh();
};
$scope.showPrevPage = function () {
if ($scope.currentPage > 1) $scope.currentPage--;
else $scope.currentPage = 1;
$scope.refresh();
};
$scope.ack = function (notification, acked, event) {
if (event) event.stopPropagation();