Skip to content

Commit

Permalink
fix(pagination): off-by-one error
Browse files Browse the repository at this point in the history
page index and page number were confused.
  • Loading branch information
chatcher committed Sep 21, 2016
1 parent 13bf807 commit 29fdb7c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/features/pagination/js/pagination.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
return index < grid.options.paginationCurrentPage - 1 ? result + size : result;
}, 0);
}
return ((grid.options.paginationCurrentPage - 1) * grid.options.paginationPageSize) + 1;
return ((grid.options.paginationCurrentPage - 1) * grid.options.paginationPageSize);
},
/**
* @ngdoc method
Expand Down
2 changes: 1 addition & 1 deletion src/features/pagination/templates/pagination.html
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
ui-grid-one-bind-title="paginationThrough">
-
</abbr>
{{ paginationApi.getLastRowIndex() }} {{paginationOf}} {{grid.options.totalItems}} {{totalItemsLabel}}
{{ 1 + paginationApi.getLastRowIndex() }} {{paginationOf}} {{grid.options.totalItems}} {{totalItemsLabel}}
</span>
</div>
</div>
Expand Down

0 comments on commit 29fdb7c

Please sign in to comment.