v1.18.x
barisusakli 10 years ago
parent 0d741f0031
commit e1f67052d0

@ -84,7 +84,7 @@ define('forum/topic', dependencies, function(pagination, infinitescroll, threadT
if (config.topicPostSort !== 'oldest_to_newest') { if (config.topicPostSort !== 'oldest_to_newest') {
postCount = 1; postCount = 1;
} }
navigator.scrollBottom(postCount); navigator.scrollBottom(postCount - 1);
}); });
}; };

@ -112,13 +112,13 @@ define('navigator', ['forum/pagination'], function(pagination) {
navigator.scrollUp = function () { navigator.scrollUp = function () {
$('body,html').animate({ $('body,html').animate({
scrollTop: $('body').scrollTop() - $(window).height() scrollTop: $(window).scrollTop() - $(window).height()
}); });
}; };
navigator.scrollDown = function () { navigator.scrollDown = function () {
$('body,html').animate({ $('body,html').animate({
scrollTop: $('body').scrollTop() + $(window).height() scrollTop: $(window).scrollTop() + $(window).height()
}); });
}; };
@ -131,6 +131,9 @@ define('navigator', ['forum/pagination'], function(pagination) {
}; };
navigator.scrollBottom = function(index) { navigator.scrollBottom = function(index) {
if (parseInt(index, 10) < 0) {
return;
}
if ($('li[data-index="' + index + '"]').length) { if ($('li[data-index="' + index + '"]').length) {
navigator.scrollToPost(index, true); navigator.scrollToPost(index, true);
} else { } else {

Loading…
Cancel
Save