mirror of
https://github.com/tubearchivist/tubearchivist
synced 2024-11-02 09:41:07 +00:00
fix linter
This commit is contained in:
parent
e052935e2d
commit
a1fbc0b436
@ -1147,23 +1147,20 @@ function createReplyButton(replyId, totalReplies) {
|
|||||||
replyButton.innerHTML = `<span id="toggle-icon">+</span> ${totalReplies} replies`;
|
replyButton.innerHTML = `<span id="toggle-icon">+</span> ${totalReplies} replies`;
|
||||||
replyButton.setAttribute('data-id', replyId);
|
replyButton.setAttribute('data-id', replyId);
|
||||||
replyButton.setAttribute('onclick', 'toggleCommentReplies(this)');
|
replyButton.setAttribute('onclick', 'toggleCommentReplies(this)');
|
||||||
return replyButton
|
return replyButton;
|
||||||
}
|
}
|
||||||
|
|
||||||
function toggleCommentReplies(button) {
|
function toggleCommentReplies(button) {
|
||||||
|
let commentReplyId = button.getAttribute('data-id');
|
||||||
let commentReplyId = button.getAttribute("data-id");
|
|
||||||
console.log('toggle comment reply for ' + commentReplyId);
|
|
||||||
let state = document.getElementById(commentReplyId).style.display;
|
let state = document.getElementById(commentReplyId).style.display;
|
||||||
|
|
||||||
if (state == "none" || state == false) {
|
if (state === 'none' || state === "") {
|
||||||
document.getElementById(commentReplyId).style.display = "block";
|
document.getElementById(commentReplyId).style.display = 'block';
|
||||||
button.querySelector("#toggle-icon").innerHTML = "-";
|
button.querySelector('#toggle-icon').innerHTML = '-';
|
||||||
} else {
|
} else {
|
||||||
document.getElementById(commentReplyId).style.display = "none";
|
document.getElementById(commentReplyId).style.display = 'none';
|
||||||
button.querySelector("#toggle-icon").innerHTML = "+";
|
button.querySelector('#toggle-icon').innerHTML = '+';
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function createCommentBox(comment, isRoot) {
|
function createCommentBox(comment, isRoot) {
|
||||||
@ -1197,7 +1194,7 @@ function createCommentBox(comment, isRoot) {
|
|||||||
commentMeta.innerHTML = `<span>${comment.comment_time_text}</span>`;
|
commentMeta.innerHTML = `<span>${comment.comment_time_text}</span>`;
|
||||||
|
|
||||||
if (comment.comment_likecount > 0) {
|
if (comment.comment_likecount > 0) {
|
||||||
let numberFormatted = formatNumbers(comment.comment_likecount)
|
let numberFormatted = formatNumbers(comment.comment_likecount);
|
||||||
commentMeta.innerHTML += `${spacer}<span class="thumb-icon"><img src="/static/img/icon-thumb.svg"> ${numberFormatted}</span>`;
|
commentMeta.innerHTML += `${spacer}<span class="thumb-icon"><img src="/static/img/icon-thumb.svg"> ${numberFormatted}</span>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user