mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-14 17:56:16 +01:00
fixed infinite load and select
This commit is contained in:
@@ -35,7 +35,7 @@ define(['forum/recent'], function(recent) {
|
||||
}
|
||||
|
||||
if (data.topics && data.topics.length) {
|
||||
recent.onTopicsLoaded('popular', data.topics);
|
||||
recent.onTopicsLoaded('popular', data.topics, false);
|
||||
$('#topics-container').attr('data-nextstart', data.nextStart);
|
||||
} else {
|
||||
$('#load-more-btn').hide();
|
||||
|
||||
@@ -107,7 +107,7 @@ define(function() {
|
||||
}
|
||||
|
||||
if (data.topics && data.topics.length) {
|
||||
Recent.onTopicsLoaded('recent', data.topics);
|
||||
Recent.onTopicsLoaded('recent', data.topics, false);
|
||||
$('#topics-container').attr('data-nextstart', data.nextStart);
|
||||
}
|
||||
|
||||
@@ -115,9 +115,9 @@ define(function() {
|
||||
});
|
||||
}
|
||||
|
||||
Recent.onTopicsLoaded = function(templateName, topics) {
|
||||
Recent.onTopicsLoaded = function(templateName, topics, showSelect) {
|
||||
ajaxify.loadTemplate(templateName, function(template) {
|
||||
var html = templates.parse(templates.getBlock(template, 'topics'), {topics: topics});
|
||||
var html = templates.parse(templates.getBlock(template, 'topics'), {topics: topics, showSelect: showSelect});
|
||||
|
||||
translator.translate(html, function(translatedHTML) {
|
||||
$('#category-no-topics').remove();
|
||||
|
||||
@@ -114,7 +114,7 @@ define(['forum/recent'], function(recent) {
|
||||
}
|
||||
|
||||
if (data.topics && data.topics.length) {
|
||||
recent.onTopicsLoaded('unread', data.topics);
|
||||
recent.onTopicsLoaded('unread', data.topics, true);
|
||||
$('#topics-container').attr('data-nextstart', data.nextStart);
|
||||
} else {
|
||||
$('#load-more-btn').hide();
|
||||
|
||||
Reference in New Issue
Block a user