web/assets/js/_src/toc.js
Cotes Chung 9992e11228 Change the ToC hiding rule.
Adapt to bootstrap-toc plugins.
2019-12-16 00:06:45 +08:00

13 lines
No EOL
251 B
JavaScript

/*
* Hide the empty ToC in posts.
*
* © 2019 Cotes Chung
* MIT Licensed
*/
$(function() {
if ($("#post-wrap .post-content h1").length == 0
&& $("#post-wrap .post-content h2").length == 0) {
$("#toc-wrap").addClass("hidden");
}
});