fix navigator displaying wrong index

related to #4998
This commit is contained in:
barisusakli
2016-08-31 23:23:25 +03:00
parent b84f36cc20
commit 8868668daa
2 changed files with 3 additions and 3 deletions

View File

@@ -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);

View File

@@ -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;