mattiash / angular-tablesort

Sort angularjs tables easily
MIT License
184 stars 66 forks source link

Patch small error in getPageRangeString-function #75

Closed Thorbijoern closed 7 years ago

Thorbijoern commented 7 years ago

There were an error in which the function produces a wrong range. for example, you are on page 7 and you got 100 Items and 10 Pages (10 Items per page): the old Code: ($scope.pagination.currentPage - 1) * ($scope.pagination.perPage + 1) (7 - 1) * (10 + 1) 6 * 11 = 66 (you get "Showing 66-70 of 100 items", in this range are only 5 items)

the new Code: ($scope.pagination.currentPage - 1) * $scope.pagination.perPage + 1 (7 - 1) * 10 + 1 6 * 10 + 1 = 61 (you get "Showing 61-70 of 100 items", in this range are the expected 10 items)