Skip to content

Commit 8f8ce47

Browse files
committed
2 parents dad7c1e + 0825072 commit 8f8ce47

File tree

4 files changed

+9
-40
lines changed

4 files changed

+9
-40
lines changed

examples/index.html

+3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
<meta charset="utf-8">
55
<title>react-bootstrap-table demo</title>
66
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css">
7+
<script src="http://code.jquery.com/jquery-2.1.3.min.js"></script>
8+
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script>
9+
710
</head>
811
<body>
912
<div id="root"></div>

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@
5959
},
6060
"dependencies": {
6161
"classnames": "^2.1.2",
62-
"react-onclickoutside": "^4.5.0",
6362
"react-toastr": "^2.3.1"
6463
},
6564
"peerDependencies": {

src/pagination/PaginationList.js

+6-31
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,14 @@
11
import React from 'react';
22
import PageButton from './PageButton.js';
33
import Const from '../Const';
4-
import listensToClickOutside from 'react-onclickoutside/decorator';
5-
6-
@listensToClickOutside()
7-
class DropdownMenu extends React.Component {
8-
handleClickOutside() {
9-
this.props.hide();
10-
}
11-
12-
render() {
13-
return (
14-
<ul className="dropdown-menu" role="menu" aria-labelledby="pageDropDown" style={{display: 'block'}}>
15-
{this.props.children}
16-
</ul>
17-
);
18-
}
19-
}
204

215
class PaginationList extends React.Component {
226

237
constructor(props) {
248
super(props);
259
this.state = {
2610
currentPage: this.props.currPage,
27-
sizePerPage: this.props.sizePerPage,
28-
dropdownVisible: false
11+
sizePerPage: this.props.sizePerPage
2912
};
3013
}
3114

@@ -62,7 +45,6 @@ class PaginationList extends React.Component {
6245

6346
changeSizePerPage(e) {
6447
e.preventDefault();
65-
this.setState({ dropdownVisible: false })
6648

6749
var selectSize = parseInt(e.currentTarget.text);
6850
if (selectSize != this.state.sizePerPage) {
@@ -103,24 +85,17 @@ class PaginationList extends React.Component {
10385
{
10486
this.props.sizePerPageList.length > 1 ?
10587
<div className="dropdown">
106-
<button
107-
className="btn btn-default dropdown-toggle ignore-react-onclickoutside"
108-
type="button"
109-
id="pageDropDown"
110-
onClick={() => this.setState({ dropdownVisible: !this.state.dropdownVisible })}
111-
aria-expanded="true">
88+
<button className="btn btn-default dropdown-toggle" type="button" id="pageDropDown" data-toggle="dropdown"
89+
aria-expanded="true">
11290
{this.state.sizePerPage}
11391
<span>
11492
{" "}
11593
<span className="caret"/>
11694
</span>
11795
</button>
118-
{ this.state.dropdownVisible ?
119-
<DropdownMenu hide={() => this.setState({ dropdownVisible: false })}>
120-
{sizePerPageList}
121-
</DropdownMenu>
122-
: ""
123-
}
96+
<ul className="dropdown-menu" role="menu" aria-labelledby="pageDropDown">
97+
{sizePerPageList}
98+
</ul>
12499
</div>
125100
: ""
126101
}

webpack.production.config.js

-8
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,6 @@ module.exports = {
2020
amd: 'react'
2121
}
2222
},
23-
{
24-
'react-onclickoutside': {
25-
root: 'OnClickOutside',
26-
commonjs2: 'react-onclickoutside',
27-
commonjs: 'react-onclickoutside',
28-
amd: 'react-onclickoutside'
29-
}
30-
},
3123
{
3224
'react-dom': {
3325
root: 'ReactDOM',

0 commit comments

Comments
 (0)