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

View File

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