summaryrefslogtreecommitdiffstats
path: root/layouts/partials/scripts-end.html
diff options
context:
space:
mode:
authoramzrk22020-06-03 19:25:18 +0800
committeramzrk22020-06-03 19:25:18 +0800
commitdc8d94d73fa6f72c17b522e5bc4416129fae7967 (patch)
treefd2e2a1ca1add42f55658d360e5bccec7e7b511f /layouts/partials/scripts-end.html
parent2e9f1c5cb2ad0c74ddeeecf0afa533139464b54d (diff)
downloadhugo-theme-fuji-dc8d94d73fa6f72c17b522e5bc4416129fae7967.tar.gz
hugo-theme-fuji-dc8d94d73fa6f72c17b522e5bc4416129fae7967.tar.bz2
hugo-theme-fuji-dc8d94d73fa6f72c17b522e5bc4416129fae7967.zip
Fix aplayer toc anchors
Diffstat (limited to 'layouts/partials/scripts-end.html')
-rw-r--r--layouts/partials/scripts-end.html6
1 files changed, 4 insertions, 2 deletions
diff --git a/layouts/partials/scripts-end.html b/layouts/partials/scripts-end.html
index fee6e18..3cbc866 100644
--- a/layouts/partials/scripts-end.html
+++ b/layouts/partials/scripts-end.html
@@ -29,8 +29,10 @@
// see https://github.com/MoePlayer/APlayer/issues/242#issuecomment-602471423
document.addEventListener('DOMContentLoaded', function () {
var issueTocEle = document.querySelector('.sidebar-toc');
- var newTocEle = issueTocEle.cloneNode(true);
- issueTocEle.parentNode.replaceChild(newTocEle, issueTocEle);
+ if (issueTocEle) {
+ var newTocEle = issueTocEle.cloneNode(true);
+ issueTocEle.parentNode.replaceChild(newTocEle, issueTocEle);
+ }
});
</script>
{{ end }} \ No newline at end of file