in ArticleTemplates/assets/js/modules/comments.js [82:108]
function checkForCorrectCount() {
const firstPage = !!document.getElementsByClassName('comments__title').length;
const actualCommentBlocks = document.getElementsByClassName('block--discussion-thread').length;
const actualCommentCount = actualCommentBlocks + document.getElementsByClassName('is-response').length;
const correctCount = !!document.getElementsByClassName('comments-' + actualCommentCount).length;
const commentCount = document.getElementsByClassName('comments__count')[0];
if (firstPage && !correctCount && actualCommentBlocks < 3) {
if (commentCount) {
commentCount.style.display = 'none';
}
}
if (actualCommentCount) {
const emptyCommentBlock = document.getElementsByClassName('comments__block--empty')[0];
if (emptyCommentBlock) {
emptyCommentBlock.style.display = 'none';
}
if (commentCount) {
const shownCount = parseInt(commentCount.innerHTML);
if (shownCount < actualCommentCount) {
commentCount.innerHTML = actualCommentCount;
}
}
}
}