From f3880e76a1d8fce7bf676c0c7ca241fbbdd7a54c Mon Sep 17 00:00:00 2001 From: Michael Abashian Date: Tue, 18 Jul 2017 17:37:36 -0400 Subject: [PATCH] Fixed item of range --- awx/ui/client/src/shared/paginate/paginate.controller.js | 6 +----- awx/ui/client/src/shared/paginate/paginate.partial.html | 4 ++-- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/awx/ui/client/src/shared/paginate/paginate.controller.js b/awx/ui/client/src/shared/paginate/paginate.controller.js index 6d72e9a0ff..a8ff92572a 100644 --- a/awx/ui/client/src/shared/paginate/paginate.controller.js +++ b/awx/ui/client/src/shared/paginate/paginate.controller.js @@ -41,10 +41,6 @@ export default ['$scope', '$stateParams', '$state', '$filter', 'GetBasePath', 'Q $scope.toPage(); }; - $scope.dataCount = function() { - return $filter('number')($scope.dataset.count); - }; - $scope.toPage = function(page) { if(page === 0 || page > $scope.last) { return; @@ -132,7 +128,7 @@ export default ['$scope', '$stateParams', '$state', '$filter', 'GetBasePath', 'Q return `1 - ${$scope.pageSize}`; } else { let floor = (($scope.current - 1) * parseInt($scope.pageSize)) + 1; - let ceil = floor + parseInt($scope.pageSize) < $scope.dataset.count ? floor + parseInt($scope.pageSize) : $scope.dataset.count; + let ceil = floor + parseInt($scope.pageSize) - 1 < $scope.dataset.count ? floor + parseInt($scope.pageSize) - 1 : $scope.dataset.count; return `${floor} - ${ceil}`; } } diff --git a/awx/ui/client/src/shared/paginate/paginate.partial.html b/awx/ui/client/src/shared/paginate/paginate.partial.html index 532d715f61..9fab876eff 100644 --- a/awx/ui/client/src/shared/paginate/paginate.partial.html +++ b/awx/ui/client/src/shared/paginate/paginate.partial.html @@ -35,14 +35,14 @@ {{last}} -
+
ITEMS  {{dataRange}} - of {{dataCount()}} + of {{dataset.count | number}}
VIEW PER PAGE