Browse Source

expand.js: fix post order when new posts appear between loading index and expanding

pull/40/head
czaks 11 years ago
committed by Michael Foster
parent
commit
d82cd9b7bd
  1. 6
      js/expand.js

6
js/expand.js

@ -27,7 +27,8 @@ $(document).ready(function(){
success: function(data) {
var last_expanded = false;
$(data).find('div.post.reply').each(function() {
if(thread.find('#' + $(this).attr('id')).length == 0) {
var post_in_doc = thread.find('#' + $(this).attr('id'));
if(post_in_doc.length == 0) {
if(last_expanded) {
$(this).addClass('expanded').insertAfter(last_expanded).before('<br class="expanded">');
} else {
@ -36,6 +37,9 @@ $(document).ready(function(){
last_expanded = $(this);
}
else {
last_expanded = post_in_doc;
}
});
$('<span class="omitted"><a href="javascript:void(0)">Hide expanded replies</a>.</span>')
.insertAfter(thread.find('span.omitted').css('display', 'none'))

Loading…
Cancel
Save