fixed topics not appearing after a post in category view

v1.18.x
Baris Usakli 12 years ago
parent 585e5cd88f
commit c2aac916aa

@ -39,28 +39,25 @@
var html = templates.prepare(templates['category'].blocks['topics']).parse({ var html = templates.prepare(templates['category'].blocks['topics']).parse({
topics: [data] topics: [data]
}), }),
topic = document.createElement('div'), topic = $(html),
container = document.getElementById('topics-container'), container = $('#topics-container'),
topics = document.querySelectorAll('#topics-container a'), topics = $('#topics-container').children(),
numTopics = topics.length, numTopics = topics.length;
x;
jQuery('#topics-container, .category-sidebar').removeClass('hidden'); jQuery('#topics-container, .category-sidebar').removeClass('hidden');
jQuery('#category-no-topics').remove(); jQuery('#category-no-topics').remove();
topic.innerHTML = html;
topic = topic.querySelector('a');
if (numTopics > 0) { if (numTopics > 0) {
for (x = 0; x < numTopics; x++) { for (var x = 0; x < numTopics; x++) {
if (topics[x].querySelector('.icon-pushpin')) continue; if ($(topics[x]).find('.icon-pushpin').length)
container.insertBefore(topic, topics[x]); continue;
$(topic).hide().fadeIn('slow'); topic.insertBefore(topics[x]);
topic.hide().fadeIn('slow');
break; break;
} }
} else { } else {
container.insertBefore(topic, null); container.append(topic);
$(topic).hide().fadeIn('slow'); topic.hide().fadeIn('slow');
} }
socket.emit('api:categories.getRecentReplies', cid); socket.emit('api:categories.getRecentReplies', cid);

@ -34,10 +34,8 @@
$('#login-error-notify').hide(); $('#login-error-notify').hide();
//window.location.replace(RELATIVE_PATH + "/?loggedin"); //window.location.replace(RELATIVE_PATH + "/?loggedin");
history.go(-1); history.go(-1);
//setTimeout(function(){
app.loadConfig(); app.loadConfig();
//}, 500);
//socket.emit('api:updateHeader');
} }
}, },
error: function(data, textStatus, jqXHR) { error: function(data, textStatus, jqXHR) {

Loading…
Cancel
Save