|
1 | 1 | import React, { Component, PropTypes } from 'react'; |
| 2 | +import classSet from 'classnames'; |
2 | 3 | import PageButton from './PageButton.js'; |
3 | 4 | import SizePerPageDropDown from './SizePerPageDropDown'; |
4 | 5 | import Const from '../Const'; |
@@ -80,7 +81,7 @@ class PaginationList extends Component { |
80 | 81 | } = this.props; |
81 | 82 | this.totalPages = Math.ceil(dataSize / sizePerPage); |
82 | 83 | this.lastPage = this.props.pageStartIndex + this.totalPages - 1; |
83 | | - const pageBtns = this.makePage(); |
| 84 | + const pageBtns = this.makePage(typeof paginationPanel === 'function'); |
84 | 85 | const dropdown = this.makeDropDown(); |
85 | 86 |
|
86 | 87 | const offset = Math.abs(Const.PAGE_START_INDEX - pageStartIndex); |
@@ -180,7 +181,7 @@ class PaginationList extends Component { |
180 | 181 | return dropdown; |
181 | 182 | } |
182 | 183 |
|
183 | | - makePage() { |
| 184 | + makePage(isCustomPagingPanel = false) { |
184 | 185 | const pages = this.getPages(); |
185 | 186 | const isStart = (page, { currPage, pageStartIndex, firstPage, prePage }) => |
186 | 187 | (currPage === pageStartIndex && (page === firstPage || page === prePage)); |
@@ -209,8 +210,12 @@ class PaginationList extends Component { |
209 | 210 | </PageButton> |
210 | 211 | ); |
211 | 212 | }, this); |
| 213 | + const classname = classSet( |
| 214 | + isCustomPagingPanel ? null : 'react-bootstrap-table-page-btns-ul', |
| 215 | + 'pagination' |
| 216 | + ); |
212 | 217 | return ( |
213 | | - <ul className='react-bootstrap-table-page-btns-ul pagination'> |
| 218 | + <ul className={ classname }> |
214 | 219 | { pageBtns } |
215 | 220 | </ul> |
216 | 221 | ); |
|
0 commit comments