expand.js: fix a weird bug - thread expand not always worked due to post being loaded in DOM, but not put in a right place in a thread, or so, so check if it has been loaded in a thread instead of if it exists in DOM

This commit is contained in:
czaks 2013-07-26 22:34:06 -04:00 committed by Michael Foster
parent c0a45ba123
commit 6bf217941a

View File

@ -27,7 +27,7 @@ $(document).ready(function(){
success: function(data) {
var last_expanded = false;
$(data).find('div.post.reply').each(function() {
if($('#' + $(this).attr('id')).length == 0) {
if(thread.find('#' + $(this).attr('id')).length == 0) {
if(last_expanded) {
$(this).addClass('expanded').insertAfter(last_expanded).before('<br class="expanded">');
} else {