Skip to content

Commit

Permalink
0.2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
fuermosi777 committed Nov 8, 2016
1 parent 755edd5 commit 9fd6dae
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 11 deletions.
14 changes: 11 additions & 3 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,17 @@ module.exports = React.createClass({
componentDidMount: function componentDidMount() {
document.addEventListener('mousemove', this.handleHandlerMouseMove);
document.addEventListener('mouseup', this.handleHandlerMouseUp);
window.onload = this.handleWindowLoad;
window.addEventListener('load', this.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;
}
},
componentWillUnmount: function componentWillUnmount() {
document.removeEventListener('mousemove', this.handleHandlerMouseMove);
Expand All @@ -136,7 +146,6 @@ module.exports = React.createClass({
this.collectInfo();
this.updateTrackVisibilities();
this.handlerContainerScroll();

if (this.props.start.includes('bottom')) {
this.el.scrollTop = this.el.scrollHeight;
}
Expand Down Expand Up @@ -216,7 +225,6 @@ module.exports = React.createClass({
var scrollHeight = el.scrollHeight,
scrollWidth = el.scrollWidth;
if (scrollHeight === this.lastScrollHeight && scrollWidth === this.lastScrollWidth) return;
console.log(scrollHeight, this.offsetHeight);
this.setState({
showVeriticalTrack: scrollHeight > this.offsetHeight,
showHorizontalTrack: scrollWidth > this.offsetWidth
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.3",
"version": "0.2.4",
"description": "A react module for creating customizable scroll area",
"main": "dist/index.js",
"scripts": {
Expand Down
16 changes: 12 additions & 4 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 = "19aa799e26772e227bea"; // eslint-disable-line no-unused-vars
/******/ var hotCurrentHash = "09de511f647a59c9729a"; // eslint-disable-line no-unused-vars
/******/ var hotCurrentModuleData = {};
/******/ var hotCurrentParents = []; // eslint-disable-line no-unused-vars

Expand Down Expand Up @@ -22760,7 +22760,17 @@
componentDidMount: function componentDidMount() {
document.addEventListener('mousemove', this.handleHandlerMouseMove);
document.addEventListener('mouseup', this.handleHandlerMouseUp);
window.onload = this.handleWindowLoad;
window.addEventListener('load', this.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;
}
},
componentWillUnmount: function componentWillUnmount() {
document.removeEventListener('mousemove', this.handleHandlerMouseMove);
Expand All @@ -22774,7 +22784,6 @@
this.collectInfo();
this.updateTrackVisibilities();
this.handlerContainerScroll();

if (this.props.start.includes('bottom')) {
this.el.scrollTop = this.el.scrollHeight;
}
Expand Down Expand Up @@ -22854,7 +22863,6 @@
var scrollHeight = el.scrollHeight,
scrollWidth = el.scrollWidth;
if (scrollHeight === this.lastScrollHeight && scrollWidth === this.lastScrollWidth) return;
console.log(scrollHeight, this.offsetHeight);
this.setState({
showVeriticalTrack: scrollHeight > this.offsetHeight,
showHorizontalTrack: scrollWidth > this.offsetWidth
Expand Down
14 changes: 11 additions & 3 deletions src/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,17 @@ module.exports = React.createClass({
componentDidMount() {
document.addEventListener('mousemove', this.handleHandlerMouseMove);
document.addEventListener('mouseup', this.handleHandlerMouseUp);
window.onload = this.handleWindowLoad;
window.addEventListener('load', this.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;
}
},

componentWillUnmount() {
Expand All @@ -135,7 +145,6 @@ module.exports = React.createClass({
this.collectInfo();
this.updateTrackVisibilities();
this.handlerContainerScroll();

if (this.props.start.includes('bottom')) {
this.el.scrollTop = this.el.scrollHeight;
}
Expand Down Expand Up @@ -216,7 +225,6 @@ module.exports = React.createClass({
var el = this.el;
var scrollHeight = el.scrollHeight, scrollWidth = el.scrollWidth;
if (scrollHeight === this.lastScrollHeight && scrollWidth === this.lastScrollWidth) return;
console.log(scrollHeight, this.offsetHeight);
this.setState({
showVeriticalTrack: scrollHeight > this.offsetHeight,
showHorizontalTrack: scrollWidth > this.offsetWidth
Expand Down

0 comments on commit 9fd6dae

Please sign in to comment.