From 720711756fe310e0a41760085a81c93bcb075526 Mon Sep 17 00:00:00 2001 From: Baris Usakli Date: Fri, 29 Nov 2013 14:42:58 -0500 Subject: [PATCH] show bottom post bar after new post, fixed the insertion of new posts --- public/src/forum/topic.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/public/src/forum/topic.js b/public/src/forum/topic.js index 3c168bcc8d..3da108aab8 100644 --- a/public/src/forum/topic.js +++ b/public/src/forum/topic.js @@ -3,6 +3,12 @@ define(function() { infiniteLoaderActive = false; + function showBottomPostBar() { + if($('#post-container .post-row').length > 1) { + $('.topic-main-buttons').removeClass('hide').parent().removeClass('hide'); + } + } + Topic.init = function() { var expose_tools = templates.get('expose_tools'), tid = templates.get('topic_id'), @@ -24,16 +30,13 @@ define(function() { } } - jQuery('document').ready(function() { app.addCommasToNumbers(); app.enterRoom('topic_' + tid); - if($('#post-container .post-row').length > 1) { - $('.topic-main-buttons').removeClass('hide').parent().removeClass('hide'); - } + showBottomPostBar(); // Resetting thread state if (thread_state.locked === '1') set_locked_state(true); @@ -883,7 +886,7 @@ define(function() { $('#post-container li[data-pid]').each(function() { if(parseInt(firstPid, 10) > parseInt($(this).attr('data-pid'), 10)) { after = $(this); - if(after.hasClass('posts')) { + if(after.next().length && after.next().hasClass('post-bar')) { after = after.next(); } } else { @@ -926,6 +929,7 @@ define(function() { $('span.timeago').timeago(); $('.post-content img').addClass('img-responsive'); updatePostCount(); + showBottomPostBar(); }); }