File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change 51
51
distance = scrollTop;
52
52
} else {
53
53
let scrollElmHeight;
54
- let elOffsetTopFromScrollElm;
54
+ let elOffsetTopFromScrollElm = this . $el . getBoundingClientRect (). top ;
55
55
56
56
if (elm === window ) {
57
57
scrollElmHeight = window .innerHeight ;
58
- elOffsetTopFromScrollElm = this .$el .getBoundingClientRect ().top ;
59
58
} else {
60
59
scrollElmHeight = elm .getBoundingClientRect ().height ;
61
- elOffsetTopFromScrollElm = this .$el .getBoundingClientRect ().top -
62
- elm .getBoundingClientRect ().top ;
60
+ elOffsetTopFromScrollElm -= elm .getBoundingClientRect ().top ;
63
61
}
64
62
65
- distance = elOffsetTopFromScrollElm - scrollTop - scrollElmHeight - (elm .offsetTop || 0 );
63
+ distance = elOffsetTopFromScrollElm - scrollElmHeight - (elm .offsetTop || 0 );
66
64
}
67
65
return distance;
68
66
}
You can’t perform that action at this time.
0 commit comments