mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 09:53:32 +08:00
FIX: Without suggested topics jumping to a post had the wrong offset
This commit is contained in:
parent
df77a827e1
commit
4e1f8ec72b
|
@ -33,12 +33,11 @@ export default function offsetCalculator(y) {
|
|||
}
|
||||
|
||||
|
||||
|
||||
if (inter > ideal) {
|
||||
const bottom = $('#topic-bottom').offset().top;
|
||||
const switchPos = bottom - rawWinHeight;
|
||||
if (scrollTop > switchPos) {
|
||||
const p = Math.max(Math.min((scrollTop + inter - switchPos) / rawWinHeight, 1.0), 0.0);
|
||||
const p = Math.max(Math.min((scrollTop + inter - switchPos) / bottom, 1.0), 0.0);
|
||||
return ((1 - p) * ideal) + (p * inter);
|
||||
} else {
|
||||
return ideal;
|
||||
|
|
Loading…
Reference in New Issue
Block a user