mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-11 16:35:47 +01:00
closes #2244
This commit is contained in:
@@ -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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user