diff options
author | amzrk2 | 2020-06-03 19:25:18 +0800 |
---|---|---|
committer | amzrk2 | 2020-06-03 19:25:18 +0800 |
commit | dc8d94d73fa6f72c17b522e5bc4416129fae7967 (patch) | |
tree | fd2e2a1ca1add42f55658d360e5bccec7e7b511f /layouts/partials/scripts-end.html | |
parent | 2e9f1c5cb2ad0c74ddeeecf0afa533139464b54d (diff) | |
download | hugo-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.html | 6 |
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 |