From 83989bba88d316ea8bbc48d892cc667fab2f7e9a Mon Sep 17 00:00:00 2001 From: Benjamin Southall Date: Thu, 4 May 2017 13:56:19 +0900 Subject: [PATCH] Fix thread-stats.js to attach to correct location and count correctly. --- js/thread-stats.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/js/thread-stats.js b/js/thread-stats.js index 5785c9f3..f9db6852 100644 --- a/js/thread-stats.js +++ b/js/thread-stats.js @@ -14,8 +14,8 @@ $(document).ready(function(){ var thread_id = (document.location.pathname + document.location.search).split('/'); thread_id = thread_id[thread_id.length -1].split('+')[0].split('.')[0]; - $('#thread-links') - .after('
'); + $('.clear') + .before('
'); var el = $('#thread_stats'); el.prepend('Page ?'); if (IDsupport){ @@ -25,8 +25,8 @@ $(document).ready(function(){ el.prepend('0 replies | '); delete el; function update_thread_stats(){ - var op = $('#thread_'+ thread_id +' > div.post.op:not(.post-hover):not(.inline)').first(); - var replies = $('#thread_'+ thread_id +' > div.post.reply:not(.post-hover):not(.inline)'); + var op = $('#thread_'+ thread_id).find('div.post.op:not(.post-hover):not(.inline)').first(); + var replies = $('#thread_'+ thread_id).find('div.post.reply:not(.post-hover):not(.inline)'); // post count $('#thread_stats_posts').text(replies.length); // image count @@ -110,4 +110,4 @@ $(document).ready(function(){ $('#update_thread').click(update_thread_stats); $(document).on('new_post',update_thread_stats); }); -} \ No newline at end of file +}