🐛 Fix new comment dropdown issue (#13661)
This commit is contained in:
parent
c5ca92e289
commit
2a05955092
1 changed files with 9 additions and 2 deletions
|
|
@ -556,9 +556,16 @@ function listenForDetailsToggle() {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Increment comment, stored in `.js-comments-count`, count by one.
|
||||
*/
|
||||
function updateCommentsCount() {
|
||||
var commentsCountDiv = document.getElementsByClassName("js-comments-count")[0];
|
||||
var commentsCountData = parseInt(commentsCountDiv.dataset.commentsCount) + 1;
|
||||
const commentsCountDiv = document.querySelector(".js-comments-count");
|
||||
|
||||
// if there's nowhere to put the count return early.
|
||||
if(!commentsCountDiv) return;
|
||||
|
||||
const commentsCountData = parseInt(commentsCountDiv.dataset.commentsCount, 10) + 1;
|
||||
commentsCountDiv.dataset.commentsCount = commentsCountData;
|
||||
commentsCountDiv.innerHTML = `(${commentsCountData})`
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue