mirror of
https://github.com/discourse/discourse.git
synced 2025-02-16 08:15:00 +00:00
FIX: Couldn't track some post positions properly
This commit is contained in:
parent
5047979f96
commit
9f8b8a1c3a
@ -94,6 +94,7 @@ export default MountWidget.extend({
|
|||||||
|
|
||||||
let allAbove = true;
|
let allAbove = true;
|
||||||
let bottomView = topView;
|
let bottomView = topView;
|
||||||
|
let lastBottom = 0;
|
||||||
while (bottomView < $posts.length) {
|
while (bottomView < $posts.length) {
|
||||||
const post = $posts[bottomView];
|
const post = $posts[bottomView];
|
||||||
const $post = $(post);
|
const $post = $(post);
|
||||||
@ -112,11 +113,14 @@ export default MountWidget.extend({
|
|||||||
onscreen.push(bottomView);
|
onscreen.push(bottomView);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (currentPost === null && (viewTop <= topCheck) && (viewBottom >= topCheck)) {
|
if ((currentPost === null) &&
|
||||||
|
((viewTop <= topCheck && viewBottom >= topCheck) ||
|
||||||
|
(lastBottom <= topCheck && viewTop >= topCheck))) {
|
||||||
percent = (topCheck - viewTop) / postHeight;
|
percent = (topCheck - viewTop) / postHeight;
|
||||||
currentPost = bottomView;
|
currentPost = bottomView;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
lastBottom = viewBottom;
|
||||||
nearby.push(bottomView);
|
nearby.push(bottomView);
|
||||||
bottomView++;
|
bottomView++;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user