mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-16 22:37:49 +00:00
Don't do anything if there's no #toc
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
window.onload = function() {
|
||||
var container = document.querySelector('#toc');
|
||||
|
||||
if (container != null) {
|
||||
var toc = initTOC({
|
||||
selector: 'h2, h3',
|
||||
scope: '.post',
|
||||
@@ -15,3 +16,4 @@ window.onload = function() {
|
||||
container.appendChild(heading);
|
||||
container.appendChild(toc);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user