Selaa lähdekoodia

Fix thread-stats.js to attach to correct location and count correctly.

pull/107/head
Benjamin Southall 7 vuotta sitten
vanhempi
commit
83989bba88
1 muutettua tiedostoa jossa 5 lisäystä ja 5 poistoa
  1. +5
    -5
      js/thread-stats.js

+ 5
- 5
js/thread-stats.js Näytä tiedosto

@@ -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('<div id="thread_stats"></div>');
$('.clear')
.before('<div id="thread_stats"></div>');
var el = $('#thread_stats');
el.prepend('Page <span id="thread_stats_page">?</span>');
if (IDsupport){
@@ -25,8 +25,8 @@ $(document).ready(function(){
el.prepend('<span id="thread_stats_posts">0</span> replies |&nbsp;');
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);
});
}
}

Loading…
Peruuta
Tallenna