mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-24 01:10:31 +01:00
single arrows wont go all the way to bottom
This commit is contained in:
@@ -9,12 +9,11 @@ var dependencies = [
|
||||
'forum/topic/threadTools',
|
||||
'forum/topic/postTools',
|
||||
'forum/topic/events',
|
||||
'forum/topic/scrollTo',
|
||||
'forum/topic/browsing',
|
||||
'navigator'
|
||||
];
|
||||
|
||||
define('forum/topic', dependencies, function(pagination, infinitescroll, threadTools, postTools, events, scrollTo, browsing, navigator) {
|
||||
define('forum/topic', dependencies, function(pagination, infinitescroll, threadTools, postTools, events, browsing, navigator) {
|
||||
var Topic = {},
|
||||
currentUrl = '';
|
||||
|
||||
@@ -90,7 +89,7 @@ define('forum/topic', dependencies, function(pagination, infinitescroll, threadT
|
||||
var bookmark = localStorage.getItem('topic:' + tid + ':bookmark');
|
||||
var postIndex = getPostIndex();
|
||||
if (postIndex) {
|
||||
scrollTo.scrollToPost(postIndex - 1, true);
|
||||
navigator.scrollToPost(postIndex - 1, true);
|
||||
} else if (bookmark && (!config.usePagination || (config.usePagination && pagination.currentPage === 1)) && ajaxify.variables.get('postcount') > 1) {
|
||||
app.alert({
|
||||
alert_id: 'bookmark',
|
||||
@@ -98,7 +97,7 @@ define('forum/topic', dependencies, function(pagination, infinitescroll, threadT
|
||||
timeout: 0,
|
||||
type: 'info',
|
||||
clickfn : function() {
|
||||
scrollTo.scrollToPost(parseInt(bookmark, 10), true);
|
||||
navigator.scrollToPost(parseInt(bookmark, 10), true);
|
||||
},
|
||||
closefn : function() {
|
||||
localStorage.removeItem('topic:' + tid + ':bookmark');
|
||||
@@ -206,7 +205,7 @@ define('forum/topic', dependencies, function(pagination, infinitescroll, threadT
|
||||
app.removeAlert('bookmark');
|
||||
}
|
||||
|
||||
if (!scrollTo.active) {
|
||||
if (!navigator.scrollActive) {
|
||||
var parts = ajaxify.removeRelativePath(window.location.pathname.slice(1)).split('/');
|
||||
var topicId = parts[1],
|
||||
slug = parts[2];
|
||||
@@ -355,14 +354,14 @@ define('forum/topic', dependencies, function(pagination, infinitescroll, threadT
|
||||
}
|
||||
|
||||
function loadMorePosts(direction) {
|
||||
if (!$('#post-container').length || scrollTo.active) {
|
||||
if (!$('#post-container').length || navigator.scrollActive) {
|
||||
return;
|
||||
}
|
||||
|
||||
infinitescroll.calculateAfter(direction, '#post-container .post-row[data-index!="0"]', config.postsPerPage, function(after, offset, el) {
|
||||
loadPostsAfter(after, function() {
|
||||
if (direction < 0 && el) {
|
||||
scrollTo.scrollToPost(el.attr('data-index'), false, 0, offset);
|
||||
navigator.scrollToPost(el.attr('data-index'), false, 0, offset);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user