summaryrefslogtreecommitdiff
path: root/modules/comment
diff options
context:
space:
mode:
Diffstat (limited to 'modules/comment')
-rw-r--r--modules/comment/comment.module11
1 files changed, 7 insertions, 4 deletions
diff --git a/modules/comment/comment.module b/modules/comment/comment.module
index f23ddf280..1321edcdd 100644
--- a/modules/comment/comment.module
+++ b/modules/comment/comment.module
@@ -978,12 +978,15 @@ function comment_render($node, $cid = 0) {
if ($comment->depth > $last_depth) {
$divs++;
$output .= '<div class="indented">';
+ $last_depth++;
}
- else if ($comment->depth < $last_depth) {
- $divs--;
- $output .= '</div>';
+ else {
+ while ($comment->depth < $last_depth) {
+ $divs--;
+ $output .= '</div>';
+ $last_depth--;
+ }
}
- $last_depth = $comment->depth;
if ($mode == COMMENT_MODE_FLAT_COLLAPSED) {
$output .= theme('comment_flat_collapsed', $comment);