Skip to content

Commit f6ddb61

Browse files
李钿李钿
authored andcommitted
升级1.0.6
1 parent 52ea2b7 commit f6ddb61

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

lib/ReactPullLoad.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,12 @@ var ReactPullLoad = function (_Component) {
7676
}
7777
}, _this.setScrollTop = function (value) {
7878
if (_this.defaultConfig.container) {
79-
var conH = _this.defaultConfig.container === document.body ? document.documentElement.clientHeight : _this.defaultConfig.container.offsetHeight;
79+
var scrollH = _this.defaultConfig.container.scrollHeight;
8080
if (value < 0) {
8181
value = 0;
8282
}
83-
if (value > conH) {
84-
value = conH;
83+
if (value > scrollH) {
84+
value = scrollH;
8585
}
8686
return _this.defaultConfig.container.scrollTop = value;
8787
} else {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-pullload",
3-
"version": "1.0.5",
3+
"version": "1.0.6",
44
"description": "React compopnent pull down refresh and pull up load more",
55
"main": "./lib/index.js",
66
"scripts": {

src/ReactPullLoad.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,9 @@ export default class ReactPullLoad extends Component {
105105

106106
setScrollTop = (value)=>{
107107
if(this.defaultConfig.container){
108-
let conH = this.defaultConfig.container === document.body ? document.documentElement.clientHeight : this.defaultConfig.container.offsetHeight
108+
let scrollH = this.defaultConfig.container.scrollHeight;
109109
if(value < 0){ value = 0}
110-
if(value > conH){ value = conH}
110+
if(value > scrollH){ value = scrollH}
111111
return this.defaultConfig.container.scrollTop = value;
112112
} else{
113113
return 0;

0 commit comments

Comments
 (0)