collapse only 1st level child comments automatically if collapse_child_comments preference is true

This commit is contained in:
teddit 2021-04-10 18:03:10 +02:00
parent b9d93d4c15
commit 22efb3e380
1 changed files with 1 additions and 1 deletions

View File

@ -45,7 +45,7 @@ module.exports = function() {
}
comments_html = `
<div class="comment ${comments.depth % 2 === 0 ? 'even-depth' : 'odd-depth'}" id="${comments.id}">
<details ${user_preferences.collapse_child_comments === 'true' && comments.depth > 0 ? '' : 'open'}>
<details ${user_preferences.collapse_child_comments === 'true' && comments.depth > 0 && comments.depth < 2 ? '' : 'open'}>
<summary>
<p class="author">${commentAuthor(comments, classlist, submitter && submitter_link, moderator && moderator_badge)}</p>
<p class="ups">${ups}</p>