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]];
|
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…
Reference in New Issue
Block a user