|
|
|
@ -83,8 +83,10 @@ define(function () {
|
|
|
|
|
Category.onNewTopic = function(data) {
|
|
|
|
|
var html = templates.prepare(templates['category'].blocks['topics']).parse({
|
|
|
|
|
topics: [data]
|
|
|
|
|
}),
|
|
|
|
|
topic = $(html),
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
translator.translate(html, function(translatedHTML) {
|
|
|
|
|
var topic = $(translatedHTML),
|
|
|
|
|
container = $('#topics-container'),
|
|
|
|
|
topics = $('#topics-container').children('.category-item'),
|
|
|
|
|
numTopics = topics.length;
|
|
|
|
@ -113,6 +115,7 @@ define(function () {
|
|
|
|
|
addActiveUser(data);
|
|
|
|
|
|
|
|
|
|
$('#topics-container span.timeago').timeago();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function addActiveUser(data) {
|
|
|
|
@ -131,20 +134,22 @@ define(function () {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Category.onTopicsLoaded = function(topics) {
|
|
|
|
|
|
|
|
|
|
var html = templates.prepare(templates['category'].blocks['topics']).parse({
|
|
|
|
|
topics: topics
|
|
|
|
|
}),
|
|
|
|
|
container = $('#topics-container');
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
translator.translate(html, function(translatedHTML) {
|
|
|
|
|
var container = $('#topics-container');
|
|
|
|
|
|
|
|
|
|
jQuery('#topics-container, .category-sidebar').removeClass('hidden');
|
|
|
|
|
jQuery('#category-no-topics').remove();
|
|
|
|
|
|
|
|
|
|
html = $(html);
|
|
|
|
|
html = $(translatedHTML);
|
|
|
|
|
container.append(html);
|
|
|
|
|
|
|
|
|
|
$('#topics-container span.timeago').timeago();
|
|
|
|
|
app.makeNumbersHumanReadable(html.find('.human-readable-number'));
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Category.loadMoreTopics = function(cid) {
|
|
|
|
|