File tree Expand file tree Collapse file tree 1 file changed +6
-11
lines changed Expand file tree Collapse file tree 1 file changed +6
-11
lines changed Original file line number Diff line number Diff line change 48
48
if (dir === ' top' ) {
49
49
distance = scrollTop;
50
50
} else {
51
- const styles = getComputedStyle (elm === window ? document .body : elm);
52
- const innerHeight = elm === window
53
- ? window .innerHeight
54
- : parseInt (styles .height , 10 );
55
- const scrollHeight = elm === window
56
- ? document .body .scrollHeight
57
- : elm .scrollHeight ;
58
- const paddingTop = parseInt (styles .paddingTop , 10 );
59
- const paddingBottom = parseInt (styles .paddingBottom , 10 );
60
- distance = scrollHeight - innerHeight - scrollTop - paddingTop - paddingBottom;
51
+ const scrollElmHeight = elm === window ?
52
+ window .innerHeight :
53
+ elm .getBoundingClientRect ().height ;
54
+
55
+ distance = this .$el .offsetTop - scrollTop - scrollElmHeight - (elm .offsetTop || 0 );
61
56
}
62
57
return distance;
63
58
}
122
117
},
123
118
methods: {
124
119
attemptLoad () {
125
- const currentDistance = getCurrentDistance (this .scrollParent , this .direction );
120
+ const currentDistance = getCurrentDistance . bind ( this ) (this .scrollParent , this .direction );
126
121
if (! this .isComplete && currentDistance <= this .distance ) {
127
122
this .isLoading = true ;
128
123
this .onInfinite .call ();
You can’t perform that action at this time.
0 commit comments