Skip to content

Commit

Permalink
0.2.5
Browse files Browse the repository at this point in the history
  • Loading branch information
fuermosi777 committed Nov 8, 2016
1 parent 9fd6dae commit 9342a8c
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 35 deletions.
24 changes: 13 additions & 11 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ module.exports = React.createClass({
componentDidMount: function componentDidMount() {
document.addEventListener('mousemove', this.handleHandlerMouseMove);
document.addEventListener('mouseup', this.handleHandlerMouseUp);
window.addEventListener('load', this.handleWindowLoad);
document.addEventListener('readystatechange', this.handleReadyStateChange);

this.collectInfo();
this.updateTrackVisibilities();
Expand All @@ -137,20 +137,22 @@ module.exports = React.createClass({
componentWillUnmount: function componentWillUnmount() {
document.removeEventListener('mousemove', this.handleHandlerMouseMove);
document.removeEventListener('mouseup', this.handleHandlerMouseUp);
window.removeEventListener('load', this.handleWindowLoad);
document.removeEventListener('readystatechange', this.handleReadyStateChange);
},
componentDidUpdate: function componentDidUpdate() {
this.updateTrackVisibilities();
},
handleWindowLoad: function handleWindowLoad() {
this.collectInfo();
this.updateTrackVisibilities();
this.handlerContainerScroll();
if (this.props.start.includes('bottom')) {
this.el.scrollTop = this.el.scrollHeight;
}
if (this.props.start.includes('right')) {
this.el.scrollLeft = this.el.scrollWidth;
handleReadyStateChange: function handleReadyStateChange() {
if (document.readyState === 'complete') {
this.collectInfo();
this.updateTrackVisibilities();
this.handlerContainerScroll();
if (this.props.start.includes('bottom')) {
this.el.scrollTop = this.el.scrollHeight;
}
if (this.props.start.includes('right')) {
this.el.scrollLeft = this.el.scrollWidth;
}
}
},
collectInfo: function collectInfo() {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-free-scrollbar",
"version": "0.2.4",
"version": "0.2.5",
"description": "A react module for creating customizable scroll area",
"main": "dist/index.js",
"scripts": {
Expand Down
26 changes: 14 additions & 12 deletions site/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
/******/ }

/******/ var hotApplyOnUpdate = true;
/******/ var hotCurrentHash = "09de511f647a59c9729a"; // eslint-disable-line no-unused-vars
/******/ var hotCurrentHash = "07454e1d16a3838d18d7"; // eslint-disable-line no-unused-vars
/******/ var hotCurrentModuleData = {};
/******/ var hotCurrentParents = []; // eslint-disable-line no-unused-vars

Expand Down Expand Up @@ -22760,7 +22760,7 @@
componentDidMount: function componentDidMount() {
document.addEventListener('mousemove', this.handleHandlerMouseMove);
document.addEventListener('mouseup', this.handleHandlerMouseUp);
window.addEventListener('load', this.handleWindowLoad);
document.addEventListener('readystatechange', this.handleReadyStateChange);

this.collectInfo();
this.updateTrackVisibilities();
Expand All @@ -22775,20 +22775,22 @@
componentWillUnmount: function componentWillUnmount() {
document.removeEventListener('mousemove', this.handleHandlerMouseMove);
document.removeEventListener('mouseup', this.handleHandlerMouseUp);
window.removeEventListener('load', this.handleWindowLoad);
document.removeEventListener('readystatechange', this.handleReadyStateChange);
},
componentDidUpdate: function componentDidUpdate() {
this.updateTrackVisibilities();
},
handleWindowLoad: function handleWindowLoad() {
this.collectInfo();
this.updateTrackVisibilities();
this.handlerContainerScroll();
if (this.props.start.includes('bottom')) {
this.el.scrollTop = this.el.scrollHeight;
}
if (this.props.start.includes('right')) {
this.el.scrollLeft = this.el.scrollWidth;
handleReadyStateChange: function handleReadyStateChange() {
if (document.readyState === 'complete') {
this.collectInfo();
this.updateTrackVisibilities();
this.handlerContainerScroll();
if (this.props.start.includes('bottom')) {
this.el.scrollTop = this.el.scrollHeight;
}
if (this.props.start.includes('right')) {
this.el.scrollLeft = this.el.scrollWidth;
}
}
},
collectInfo: function collectInfo() {
Expand Down
25 changes: 14 additions & 11 deletions src/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ module.exports = React.createClass({
componentDidMount() {
document.addEventListener('mousemove', this.handleHandlerMouseMove);
document.addEventListener('mouseup', this.handleHandlerMouseUp);
window.addEventListener('load', this.handleWindowLoad);
document.addEventListener('readystatechange', this.handleReadyStateChange);

this.collectInfo();
this.updateTrackVisibilities();
Expand All @@ -134,23 +134,26 @@ module.exports = React.createClass({
componentWillUnmount() {
document.removeEventListener('mousemove', this.handleHandlerMouseMove);
document.removeEventListener('mouseup', this.handleHandlerMouseUp);
window.removeEventListener('load', this.handleWindowLoad);
document.removeEventListener('readystatechange', this.handleReadyStateChange);
},

componentDidUpdate() {
this.updateTrackVisibilities();
},

handleWindowLoad() {
this.collectInfo();
this.updateTrackVisibilities();
this.handlerContainerScroll();
if (this.props.start.includes('bottom')) {
this.el.scrollTop = this.el.scrollHeight;
}
if (this.props.start.includes('right')) {
this.el.scrollLeft = this.el.scrollWidth;
handleReadyStateChange() {
if (document.readyState === 'complete') {
this.collectInfo();
this.updateTrackVisibilities();
this.handlerContainerScroll();
if (this.props.start.includes('bottom')) {
this.el.scrollTop = this.el.scrollHeight;
}
if (this.props.start.includes('right')) {
this.el.scrollLeft = this.el.scrollWidth;
}
}

},

collectInfo() {
Expand Down

0 comments on commit 9342a8c

Please sign in to comment.