Skip to content

Node.js based forum software built for the modern web

fixed topics not appearing after a post in category view

Baris Usaklic2aac916aa97
diff --git a/public/src/forum/category.js b/public/src/forum/category.js
index e2f9c0b054..b2bc60a07f 100644
--- a/public/src/forum/category.js
+++ b/public/src/forum/category.js
@@ -39,28 +39,25 @@
var html = templates.prepare(templates['category'].blocks['topics']).parse({
topics: [data]
}),
- topic = document.createElement('div'),
- container = document.getElementById('topics-container'),
- topics = document.querySelectorAll('#topics-container a'),
- numTopics = topics.length,
- x;
+ topic = $(html),
+ container = $('#topics-container'),
+ topics = $('#topics-container').children(),
+ numTopics = topics.length;
jQuery('#topics-container, .category-sidebar').removeClass('hidden');
jQuery('#category-no-topics').remove();
- topic.innerHTML = html;
- topic = topic.querySelector('a');
-
if (numTopics > 0) {
- for (x = 0; x < numTopics; x++) {
- if (topics[x].querySelector('.icon-pushpin')) continue;
- container.insertBefore(topic, topics[x]);
- $(topic).hide().fadeIn('slow');
+ for (var x = 0; x < numTopics; x++) {
+ if ($(topics[x]).find('.icon-pushpin').length)
+ continue;
+ topic.insertBefore(topics[x]);
+ topic.hide().fadeIn('slow');
break;
}
} else {
- container.insertBefore(topic, null);
- $(topic).hide().fadeIn('slow');
+ container.append(topic);
+ topic.hide().fadeIn('slow');
}
socket.emit('api:categories.getRecentReplies', cid);
diff --git a/public/src/forum/login.js b/public/src/forum/login.js
index 0fbf475521..8d3b3e56fa 100644
--- a/public/src/forum/login.js
+++ b/public/src/forum/login.js
@@ -34,10 +34,8 @@
$('#login-error-notify').hide();
//window.location.replace(RELATIVE_PATH + "/?loggedin");
history.go(-1);
- //setTimeout(function(){
- app.loadConfig();
- //}, 500);
- //socket.emit('api:updateHeader');
+
+ app.loadConfig();
}
},
error: function(data, textStatus, jqXHR) {