mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-18 03:31:03 +01:00
fixes to infinitescroll
This commit is contained in:
@@ -19,21 +19,24 @@ define('forum/account/topics', ['forum/account/header', 'forum/infinitescroll'],
|
||||
infinitescroll.loadMore('topics.loadMoreFromSet', {
|
||||
set: 'uid:' + $('.account-username-box').attr('data-uid') + ':topics',
|
||||
after: $('.user-topics').attr('data-nextstart')
|
||||
}, function(data) {
|
||||
}, function(data, done) {
|
||||
|
||||
if (data.topics && data.topics.length) {
|
||||
onTopicsLoaded(data.topics);
|
||||
onTopicsLoaded(data.topics, done);
|
||||
$('.user-topics').attr('data-nextstart', data.nextStart);
|
||||
} else {
|
||||
done();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function onTopicsLoaded(topics) {
|
||||
function onTopicsLoaded(topics, callback) {
|
||||
infinitescroll.parseAndTranslate('account/topics', 'topics', {topics: topics}, function(html) {
|
||||
$('#topics-container').append(html);
|
||||
html.find('span.timeago').timeago();
|
||||
app.createUserTooltips();
|
||||
utils.makeNumbersHumanReadable(html.find('.human-readable-number'));
|
||||
callback();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user