diff --git a/include/conversation.php b/include/conversation.php index 5743a2929e..d32a9a6667 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -582,11 +582,13 @@ function prepare_threads_body($a, $items, $cmnt_tpl, $page_writeable, $mode, $pr $item_result['children'] = array(); if(count($item['children'])) { + $collapse_all_children = $collapse_all; if(!$toplevelpost && !$collapse_all) - $collapse_all = true; - $item_result['children'] = prepare_threads_body($a, $item['children'], $cmnt_tpl, $page_writeable, $mode, $profile_owner, $collapse_all); + $collapse_all_children = true; + $item_result['children'] = prepare_threads_body($a, $item['children'], $cmnt_tpl, $page_writeable, $mode, $profile_owner, $collapse_all_children); } $item_result['private'] = $item['private']; + $item_result['toplevel'] = ($toplevelpost ? 'toplevel_item' : ''); $result[] = $item_result; } @@ -812,7 +814,6 @@ function conversation(&$a, $items, $mode, $update, $preview = false, $thr_c = fa } else { - // Figure out how many comments each parent has // (Comments all have gravity of 6) // Store the result in the $comments array diff --git a/js/main.js b/js/main.js index c7db9a0691..6ab574c4e8 100644 --- a/js/main.js +++ b/js/main.js @@ -280,8 +280,7 @@ //}); // add a new thread - - $('.tread-wrapper',data).each(function() { + $('.toplevel_item',data).each(function() { var ident = $(this).attr('id'); if($('#' + ident).length == 0 && profile_page == 1) { diff --git a/view/wall_thread.tpl b/view/wall_thread.tpl index 96a98ca82a..8142a7842a 100644 --- a/view/wall_thread.tpl +++ b/view/wall_thread.tpl @@ -4,7 +4,7 @@