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,8 +55,14 @@
|
|||||||
count = resp.commentCounts[paths[i]];
|
count = resp.commentCounts[paths[i]];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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");
|
doms[i].innerText = count + " " + (count === 1 ? "comment" : "comments");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user