react-custom-scrollbars
Advanced tools
Comparing version 2.0.0 to 2.0.1
@@ -321,2 +321,3 @@ 'use strict'; | ||
addListeners: function addListeners() { | ||
if (typeof document === 'undefined') return; | ||
this.refs.view.addEventListener('scroll', this.handleScroll); | ||
@@ -327,6 +328,7 @@ this.refs.barVertical.addEventListener('mousedown', this.handleVerticalTrackMouseDown); | ||
this.refs.thumbHorizontal.addEventListener('mousedown', this.handleHorizontalThumbMouseDown); | ||
if (document) document.addEventListener('mouseup', this.handleDocumentMouseUp); | ||
if (window) window.addEventListener('resize', this.handleWindowResize); | ||
document.addEventListener('mouseup', this.handleDocumentMouseUp); | ||
window.addEventListener('resize', this.handleWindowResize); | ||
}, | ||
removeListeners: function removeListeners() { | ||
if (typeof document === 'undefined') return; | ||
this.refs.view.removeEventListener('scroll', this.handleScroll); | ||
@@ -337,4 +339,4 @@ this.refs.barVertical.removeEventListener('mousedown', this.handleVerticalTrackMouseDown); | ||
this.refs.thumbHorizontal.removeEventListener('mousedown', this.handleHorizontalThumbMouseDown); | ||
if (document) document.removeEventListener('mouseup', this.handleDocumentMouseUp); | ||
if (window) window.removeEventListener('resize', this.handleWindowResize); | ||
document.removeEventListener('mouseup', this.handleDocumentMouseUp); | ||
window.removeEventListener('resize', this.handleWindowResize); | ||
}, | ||
@@ -341,0 +343,0 @@ render: function render() { |
@@ -18,3 +18,3 @@ 'use strict'; | ||
if (scrollbarWidth !== false) return scrollbarWidth; | ||
if (document) { | ||
if (typeof document !== 'undefined') { | ||
var div = document.createElement('div'); | ||
@@ -21,0 +21,0 @@ (0, _domCss2.default)(div, { |
{ | ||
"name": "react-custom-scrollbars", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "React scrollbars component", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
33106
503