File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change 4646 */
4747 function getCurrentDistance (elm , dir ) {
4848 let distance;
49- const scrollTop = isNaN ( elm . scrollTop ) ? elm . pageYOffset : elm . scrollTop ;
49+
5050 if (dir === ' top' ) {
51- distance = scrollTop;
51+ distance = isNaN ( elm . scrollTop ) ? elm . pageYOffset : elm . scrollTop ;
5252 } else {
5353 let scrollElmHeight;
54- let elOffsetTopFromScrollElm = this .$el .getBoundingClientRect ().top ;
54+ let elOffsetTop = this .$el .getBoundingClientRect ().top ;
5555
5656 if (elm === window ) {
5757 scrollElmHeight = window .innerHeight ;
5858 } else {
59- scrollElmHeight = elm .getBoundingClientRect (). height ;
60- elOffsetTopFromScrollElm -= elm .getBoundingClientRect ().top ;
59+ scrollElmHeight = elm .clientHeight ;
60+ elOffsetTop -= elm .getBoundingClientRect ().top ;
6161 }
62-
63- distance = elOffsetTopFromScrollElm - scrollElmHeight - (elm .offsetTop || 0 );
62+ distance = elOffsetTop - scrollElmHeight;
6463 }
64+
6565 return distance;
6666 }
6767
You can’t perform that action at this time.
0 commit comments