From 1fc596b74b4135917eabac60df28f8471d53933d Mon Sep 17 00:00:00 2001 From: psychobunny Date: Tue, 11 Jun 2013 16:36:33 -0400 Subject: [PATCH] fixed sidebar flashing in on empty category - got rid of javascript control and set the visibility properly from serverside --- public/src/forum/category.js | 9 ++------- public/templates/category.tpl | 8 ++++---- src/categories.js | 10 ++++++++-- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/public/src/forum/category.js b/public/src/forum/category.js index 620ba2eae9..4388198e5b 100644 --- a/public/src/forum/category.js +++ b/public/src/forum/category.js @@ -15,11 +15,6 @@ 'event:new_topic' ]); - if (jQuery('.category-item').length == 0) { - jQuery('#topics-container, .category-sidebar').hide(); - jQuery('#category-no-topics').show(); - } - socket.on('event:new_topic', function(data) { var html = templates.prepare(templates['category'].blocks['topics']).parse({ topics: [data] }), topic = document.createElement('div'), @@ -28,8 +23,8 @@ numTopics = topics.length, x; - jQuery('#topics-container, .category-sidebar').show(); - jQuery('#category-no-topics').hide(); + jQuery('#topics-container, .category-sidebar').removeClass('hidden'); + jQuery('#category-no-topics').remove(); topic.innerHTML = html; if (numTopics > 0) { diff --git a/public/templates/category.tpl b/public/templates/category.tpl index e730e33e34..38fa7a059f 100644 --- a/public/templates/category.tpl +++ b/public/templates/category.tpl @@ -5,7 +5,7 @@
-
+
There are no topics in this category.
Why don't you try posting one?
@@ -42,10 +42,10 @@ -
- +
+
-
+