Skip to content

Commit

Permalink
Merge e1e5dff into 384fe99
Browse files Browse the repository at this point in the history
  • Loading branch information
zation authored Aug 17, 2017
2 parents 384fe99 + e1e5dff commit f397d4c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/Pager.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const Pager = (props) => {
onKeyPress={handleKeyPress}
tabIndex="0"
>
{props.itemRender(props.page, 'page')}
{props.itemRender(props.page, 'page', props.allPages)}
</li>
);
};
Expand All @@ -45,6 +45,7 @@ Pager.propTypes = {
onClick: PropTypes.func,
onKeyPress: PropTypes.func,
itemRender: PropTypes.func,
allPages: PropTypes.number,
};

export default Pager;
12 changes: 8 additions & 4 deletions src/Pagination.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,7 @@ export default class Pagination extends React.Component {
active={active}
showTitle={props.showTitle}
itemRender={props.itemRender}
allPages={allPages}
/>
);
}
Expand All @@ -376,7 +377,7 @@ export default class Pagination extends React.Component {
onKeyPress={this.runIfEnterJumpPrev}
className={`${prefixCls}-jump-prev`}
>
{props.itemRender(this.getJumpPrevPage(), 'jump-prev')}
{props.itemRender(this.getJumpPrevPage(), 'jump-prev', allPages)}
</li>
);
jumpNext = (
Expand All @@ -388,7 +389,7 @@ export default class Pagination extends React.Component {
onKeyPress={this.runIfEnterJumpNext}
className={`${prefixCls}-jump-next`}
>
{props.itemRender(this.getJumpNextPage(), 'jump-next')}
{props.itemRender(this.getJumpNextPage(), 'jump-next', allPages)}
</li>
);
lastPager = (
Expand All @@ -403,6 +404,7 @@ export default class Pagination extends React.Component {
active={false}
showTitle={props.showTitle}
itemRender={props.itemRender}
allPages={allPages}
/>
);
firstPager = (
Expand All @@ -416,6 +418,7 @@ export default class Pagination extends React.Component {
active={false}
showTitle={props.showTitle}
itemRender={props.itemRender}
allPages={allPages}
/>
);

Expand Down Expand Up @@ -443,6 +446,7 @@ export default class Pagination extends React.Component {
active={active}
showTitle={props.showTitle}
itemRender={props.itemRender}
allPages={allPages}
/>
);
}
Expand Down Expand Up @@ -502,7 +506,7 @@ export default class Pagination extends React.Component {
className={`${!prevDisabled ? '' : `${prefixCls}-disabled`} ${prefixCls}-prev`}
aria-disabled={prevDisabled}
>
{props.itemRender(prevPage, 'prev')}
{props.itemRender(prevPage, 'prev', allPages)}
</li>
{pagerList}
<li
Expand All @@ -513,7 +517,7 @@ export default class Pagination extends React.Component {
className={`${!nextDisabled ? '' : `${prefixCls}-disabled`} ${prefixCls}-next`}
aria-disabled={nextDisabled}
>
{props.itemRender(nextPage, 'next')}
{props.itemRender(nextPage, 'next', allPages)}
</li>
<Options
locale={props.locale}
Expand Down

0 comments on commit f397d4c

Please sign in to comment.