mirror of
https://codeberg.org/teddit/teddit.git
synced 2026-04-23 22:35:05 -04:00
Add depth of each comment to the json. When creating the html, determine if the comment is an even or odd depth for css.
This commit is contained in:
@@ -38,7 +38,7 @@ module.exports = function() {
|
||||
edited_span = `<span title="this comment is edited">*</span>`
|
||||
}
|
||||
comments_html = `
|
||||
<div class="comment" id="${comments.id}">
|
||||
<div class="comment ${comments.depth % 2 === 0 ? 'even-depth' : 'odd-depth'}" id="${comments.id}">
|
||||
<details open>
|
||||
<summary>
|
||||
<p class="author">${commentAuthor(comments, classlist, submitter && submitter_link, moderator && moderator_badge)}</p>
|
||||
@@ -124,7 +124,7 @@ module.exports = function() {
|
||||
edited_span = `<span title="this comment is edited">*</span>`
|
||||
}
|
||||
comments_html += `
|
||||
<div class="comment" id="${comment.id}">
|
||||
<div class="comment ${comment.depth % 2 === 0 ? 'even-depth' : 'odd-depth'} id="${comment.id}">
|
||||
<details open>
|
||||
<summary>
|
||||
<p class="author">${commentAuthor(comment, classlist, submitter && submitter_link, moderator && moderator_badge)}</p>
|
||||
|
||||
Reference in New Issue
Block a user