@@ -27,12 +27,14 @@ export default createClass({
27
27
displayName : 'Scrollbars' ,
28
28
29
29
propTypes : {
30
+ onScroll : PropTypes . func ,
30
31
scrollbarHorizontal : PropTypes . func ,
31
32
scrollbarVertical : PropTypes . func ,
32
33
thumbHorizontal : PropTypes . func ,
33
34
thumbVertical : PropTypes . func ,
34
35
view : PropTypes . func ,
35
- onScroll : PropTypes . func
36
+ style : PropTypes . object ,
37
+ children : PropTypes . node ,
36
38
} ,
37
39
38
40
getDefaultProps ( ) {
@@ -58,26 +60,6 @@ export default createClass({
58
60
this . removeListeners ( ) ;
59
61
} ,
60
62
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
-
81
63
getPosition ( ) {
82
64
const { view } = this . refs ;
83
65
const {
@@ -314,6 +296,26 @@ export default createClass({
314
296
this . update ( ) ;
315
297
} ,
316
298
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
+
317
319
render ( ) {
318
320
const scrollbarWidth = getScrollbarWidth ( ) ;
319
321
const {
0 commit comments