fix navigator displaying wrong index

related to #4998
v1.18.x
barisusakli 9 years ago
parent b84f36cc20
commit 8868668daa

@ -63,7 +63,7 @@ define('forum/topic', [
handleKeys();
navigator.init('[component="post/anchor"]', ajaxify.data.postcount, Topic.toTop, Topic.toBottom, Topic.navigatorCallback, Topic.calculateIndex);
navigator.init('[component="post"]', ajaxify.data.postcount, Topic.toTop, Topic.toBottom, Topic.navigatorCallback, Topic.calculateIndex);
handleBookmark(tid);

@ -131,8 +131,8 @@ define('navigator', ['forum/pagination', 'components'], function(pagination, com
}
});
var atTop = scrollTop === 0 && parseInt(els.first().attr('data-index'), 10) === 0,
nearBottom = scrollTop + windowHeight > documentHeight - 100 && parseInt(els.last().attr('data-index'), 10) === count - 1;
var atTop = scrollTop === 0 && parseInt(els.first().attr('data-index'), 10) === 0;
var nearBottom = scrollTop + windowHeight > documentHeight - 100 && parseInt(els.last().attr('data-index'), 10) === count - 1;
if (atTop) {
index = 1;

Loading…
Cancel
Save