Skip to content

Commit 419bff5

Browse files
author
Malte W
committed
fix linting errors
1 parent cbd1d00 commit 419bff5

File tree

1 file changed

+23
-21
lines changed

1 file changed

+23
-21
lines changed

src/Scrollbars.js

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,14 @@ export default createClass({
2727
displayName: 'Scrollbars',
2828

2929
propTypes: {
30+
onScroll: PropTypes.func,
3031
scrollbarHorizontal: PropTypes.func,
3132
scrollbarVertical: PropTypes.func,
3233
thumbHorizontal: PropTypes.func,
3334
thumbVertical: PropTypes.func,
3435
view: PropTypes.func,
35-
onScroll: PropTypes.func
36+
style: PropTypes.object,
37+
children: PropTypes.node,
3638
},
3739

3840
getDefaultProps() {
@@ -58,26 +60,6 @@ export default createClass({
5860
this.removeListeners();
5961
},
6062

61-
addListeners() {
62-
this.refs.view.addEventListener('scroll', this.handleScroll);
63-
this.refs.barVertical.addEventListener('mousedown', this.handleVerticalTrackMouseDown);
64-
this.refs.barHorizontal.addEventListener('mousedown', this.handleHorizontalTrackMouseDown);
65-
this.refs.thumbVertical.addEventListener('mousedown', this.handleVerticalThumbMouseDown);
66-
this.refs.thumbHorizontal.addEventListener('mousedown', this.handleHorizontalThumbMouseDown);
67-
if (document) document.addEventListener('mouseup', this.handleDocumentMouseUp);
68-
if (window) window.addEventListener('resize', this.handleWindowResize);
69-
},
70-
71-
removeListeners() {
72-
this.refs.view.removeEventListener('scroll', this.handleScroll);
73-
this.refs.barVertical.removeEventListener('mousedown', this.handleVerticalTrackMouseDown);
74-
this.refs.barHorizontal.removeEventListener('mousedown', this.handleHorizontalTrackMouseDown);
75-
this.refs.thumbVertical.removeEventListener('mousedown', this.handleVerticalThumbMouseDown);
76-
this.refs.thumbHorizontal.removeEventListener('mousedown', this.handleHorizontalThumbMouseDown);
77-
if (document) document.removeEventListener('mouseup', this.handleDocumentMouseUp);
78-
if (window) window.removeEventListener('resize', this.handleWindowResize);
79-
},
80-
8163
getPosition() {
8264
const { view } = this.refs;
8365
const {
@@ -314,6 +296,26 @@ export default createClass({
314296
this.update();
315297
},
316298

299+
addListeners() {
300+
this.refs.view.addEventListener('scroll', this.handleScroll);
301+
this.refs.barVertical.addEventListener('mousedown', this.handleVerticalTrackMouseDown);
302+
this.refs.barHorizontal.addEventListener('mousedown', this.handleHorizontalTrackMouseDown);
303+
this.refs.thumbVertical.addEventListener('mousedown', this.handleVerticalThumbMouseDown);
304+
this.refs.thumbHorizontal.addEventListener('mousedown', this.handleHorizontalThumbMouseDown);
305+
if (document) document.addEventListener('mouseup', this.handleDocumentMouseUp);
306+
if (window) window.addEventListener('resize', this.handleWindowResize);
307+
},
308+
309+
removeListeners() {
310+
this.refs.view.removeEventListener('scroll', this.handleScroll);
311+
this.refs.barVertical.removeEventListener('mousedown', this.handleVerticalTrackMouseDown);
312+
this.refs.barHorizontal.removeEventListener('mousedown', this.handleHorizontalTrackMouseDown);
313+
this.refs.thumbVertical.removeEventListener('mousedown', this.handleVerticalThumbMouseDown);
314+
this.refs.thumbHorizontal.removeEventListener('mousedown', this.handleHorizontalThumbMouseDown);
315+
if (document) document.removeEventListener('mouseup', this.handleDocumentMouseUp);
316+
if (window) window.removeEventListener('resize', this.handleWindowResize);
317+
},
318+
317319
render() {
318320
const scrollbarWidth = getScrollbarWidth();
319321
const {

0 commit comments

Comments
 (0)