fixed infinite load and select

v1.18.x
barisusakli 11 years ago
parent 42c9185c7d
commit d1ec101248

@ -35,7 +35,7 @@ define(['forum/recent'], function(recent) {
} }
if (data.topics && data.topics.length) { if (data.topics && data.topics.length) {
recent.onTopicsLoaded('popular', data.topics); recent.onTopicsLoaded('popular', data.topics, false);
$('#topics-container').attr('data-nextstart', data.nextStart); $('#topics-container').attr('data-nextstart', data.nextStart);
} else { } else {
$('#load-more-btn').hide(); $('#load-more-btn').hide();

@ -107,7 +107,7 @@ define(function() {
} }
if (data.topics && data.topics.length) { if (data.topics && data.topics.length) {
Recent.onTopicsLoaded('recent', data.topics); Recent.onTopicsLoaded('recent', data.topics, false);
$('#topics-container').attr('data-nextstart', data.nextStart); $('#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) { 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) { translator.translate(html, function(translatedHTML) {
$('#category-no-topics').remove(); $('#category-no-topics').remove();

@ -114,7 +114,7 @@ define(['forum/recent'], function(recent) {
} }
if (data.topics && data.topics.length) { if (data.topics && data.topics.length) {
recent.onTopicsLoaded('unread', data.topics); recent.onTopicsLoaded('unread', data.topics, true);
$('#topics-container').attr('data-nextstart', data.nextStart); $('#topics-container').attr('data-nextstart', data.nextStart);
} else { } else {
$('#load-more-btn').hide(); $('#load-more-btn').hide();

Loading…
Cancel
Save