Fixes: U4-5820 List View showing content of complete site after deleting last page of data

This commit is contained in:
Shannon
2014-11-18 10:50:56 +11:00
parent d61d6008da
commit c47d59a257
2 changed files with 10 additions and 1 deletions

View File

@@ -86,8 +86,14 @@ function listViewController($rootScope, $scope, $routeParams, $injector, notific
$scope.pagination[i] = { index: i, name: i + 1 };
}
//NOTE: This might occur if we are requesting a higher page number than what is actually available, for example
// if you have more than one page and you delete all items on the last page. In this case, we need to reset to the last
// available page and then re-load again
if ($scope.options.pageNumber > $scope.listViewResultSet.totalPages) {
$scope.options.pageNumber = $scope.listViewResultSet.totalPages;
//reload!
$scope.reloadView(id);
}
});