File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change 5050 if (dir === ' top' ) {
5151 distance = scrollTop;
5252 } else {
53- const elmBoundingClientRect = elm .getBoundingClientRect ();
54- const scrollElmHeight = elm === window ?
55- window .innerHeight :
56- elmBoundingClientRect .height ;
57- const elOffsetTopFromScrollElm = this .$el .getBoundingClientRect ().top -
58- elmBoundingClientRect .top ;
53+ let scrollElmHeight;
54+ let elOffsetTopFromScrollElm;
55+
56+ if (elm === window ) {
57+ scrollElmHeight = window .innerHeight ;
58+ elOffsetTopFromScrollElm = this .$el .getBoundingClientRect ().top ;
59+ } else {
60+ scrollElmHeight = elm .getBoundingClientRect ().height ;
61+ elOffsetTopFromScrollElm = this .$el .getBoundingClientRect ().top -
62+ elm .getBoundingClientRect ().top ;
63+ }
5964
6065 distance = elOffsetTopFromScrollElm - scrollTop - scrollElmHeight - (elm .offsetTop || 0 );
6166 }
You can’t perform that action at this time.
0 commit comments