Skip to content

Commit

Permalink
Merge pull request react-bootstrap#946 from firework1230/master
Browse files Browse the repository at this point in the history
Split commit of PR react-bootstrap#939
  • Loading branch information
AlexKVal committed Jul 6, 2015
2 parents 25a716f + c64679f commit 1d18e59
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Pagination.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ const Pagination = React.createClass({
if(!hasHiddenPagesAfter){
endPage = items;
startPage = items - maxButtons + 1;
if(startPage < 1){
startPage = 1;
}
} else {
endPage = startPage + maxButtons - 1;
}
Expand Down Expand Up @@ -109,7 +112,7 @@ const Pagination = React.createClass({
<PaginationButton
key='next'
eventKey={this.props.activePage + 1}
disabled={this.props.activePage === this.props.items}
disabled={this.props.activePage >= this.props.items}
onSelect={this.props.onSelect}>
<span aria-label='Next'>&rsaquo;</span>
</PaginationButton>
Expand Down Expand Up @@ -141,7 +144,7 @@ const Pagination = React.createClass({
<PaginationButton
key='last'
eventKey={this.props.items}
disabled={this.props.activePage === this.props.items}
disabled={this.props.activePage >= this.props.items}
onSelect={this.props.onSelect}>
<span aria-label='Last'>&raquo;</span>
</PaginationButton>
Expand Down

0 comments on commit 1d18e59

Please sign in to comment.