mirror of
https://github.com/ansible/awx.git
synced 2026-01-14 11:20:39 -03:30
Fixed item of range
This commit is contained in:
parent
5dc354ee4b
commit
f3880e76a1
@ -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}`;
|
||||
}
|
||||
}
|
||||
|
||||
@ -35,14 +35,14 @@
|
||||
<span id="total-pages">{{last}}</span>
|
||||
</span>
|
||||
</div>
|
||||
<div class="Paginate-total page-label" ng-hide="dataCount === 0">
|
||||
<div class="Paginate-total page-label" ng-hide="dataset.count === 0">
|
||||
<!-- TODO: Move the ITEMS line into paginate.directive.js
|
||||
so that i18n.sprintf("A of B") can be used but
|
||||
it seems $sce.trustAsHtml() does not work with html tag.
|
||||
-->
|
||||
<span class="Paginate-itemsOf" translate>ITEMS
|
||||
<span>{{dataRange}}</span>
|
||||
<span ng-hide="dataset.count <= basePageSize">of {{dataCount()}}</span>
|
||||
<span ng-hide="dataset.count <= basePageSize">of {{dataset.count | number}}</span>
|
||||
</span>
|
||||
<div class="Paginate-filteringDropdowns" ng-hide="hideViewPerPage || dataset.count <= basePageSize">
|
||||
<div class="Paginate-filterLabel" translate>VIEW PER PAGE</div>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user