Skip to content

Commit

Permalink
If the table has only one page or no pages at all, it won't show any …
Browse files Browse the repository at this point in the history
…navigation controls on the pagination.
  • Loading branch information
diazproduction committed Feb 5, 2016
1 parent c18cd93 commit a7cc047
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/pagination/PaginationList.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,16 +144,19 @@ class PaginationList extends React.Component {
var pages;
if(startPage != 1 && this.totalPages > this.props.paginationSize) {
pages = [this.props.firstPage, this.props.prePage];
} else {
} else if (this.totalPages > 1) {
pages = [this.props.prePage];
}
else {
pages = []
}
for (var i = startPage; i <= endPage; i++) {
if (i > 0)pages.push(i);
}
if (endPage != this.totalPages) {
pages.push(this.props.nextPage);
pages.push(this.props.lastPage);
} else {
} else if (this.totalPages > 1){
pages.push(this.props.nextPage);
}
return pages;
Expand Down

0 comments on commit a7cc047

Please sign in to comment.