mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 13:09:18 +08:00
FIX: Scrolling to the bottom was still a bit weird with no suggested
This commit is contained in:
parent
29ddb3a611
commit
f41ab98e86
|
@ -36,8 +36,12 @@ export default function offsetCalculator(y) {
|
|||
if (inter > ideal) {
|
||||
const bottom = $('#topic-bottom').offset().top;
|
||||
const switchPos = bottom - rawWinHeight;
|
||||
if (scrollPercent >= 1.0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (scrollTop > switchPos) {
|
||||
const p = Math.max(Math.min((scrollTop + inter - switchPos) / bottom, 1.0), 0.0);
|
||||
const p = Math.max(Math.min((scrollTop + inter - switchPos) / rawWinHeight, 1.0), 0.0);
|
||||
return ((1 - p) * ideal) + (p * inter);
|
||||
} else {
|
||||
return ideal;
|
||||
|
|
Loading…
Reference in New Issue
Block a user