mirror of
https://gitlab.com/commento/commento.git
synced 2025-04-28 06:30:28 -04:00
count.js: allow customizing no comments text
Optional 'data-hide-no-comments-count' allows to hide comments count when there are no comments.
This commit is contained in:
parent
f37e26bfc2
commit
ff04981cf5
@ -55,7 +55,13 @@
|
||||
count = resp.commentCounts[paths[i]];
|
||||
}
|
||||
|
||||
doms[i].innerText = count + " " + (count === 1 ? "comment" : "comments");
|
||||
var useCustomCommentsText = doms[i].getAttribute("data-custom-comments-text") !== null;
|
||||
|
||||
if(useCustomCommentsText) {
|
||||
doms[i].innerText = eval(doms[i].getAttribute("data-custom-comments-text"))(count);
|
||||
} else {
|
||||
doms[i].innerText = count + " " + (count === 1 ? "comment" : "comments");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user