diff options
| author | Reorx <novoreorx@gmail.com> | 2022-05-19 22:41:42 +0800 |
|---|---|---|
| committer | Reorx <novoreorx@gmail.com> | 2022-05-19 22:41:42 +0800 |
| commit | 3f1e99e8b484e9e778dd3dc65302b3623f1b3c83 (patch) | |
| tree | e62deae09bb07ed5dd5e4868095d2be6fd5b99c0 | |
| parent | 24749f16d0e2b49507d049966f2ddb834cf80dc5 (diff) | |
fixup! split page_footer.html from footer.html
| -rw-r--r-- | layouts/partials/page_footer.html | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/layouts/partials/page_footer.html b/layouts/partials/page_footer.html index 673a208..589292b 100644 --- a/layouts/partials/page_footer.html +++ b/layouts/partials/page_footer.html @@ -57,10 +57,13 @@ // every page loaded by InstantClick should run the <script> tags again. (function() { const enableTocScroll = '{{- if (and (eq .Kind "page") (.Content) (.Param "ShowToc") (.Param "TocSide")) }}1{{ end }}' == '1' - // always get an array here - let scrollListeners = window.scrollListeners + if (!enableTocScroll) { + return + } // console.log('enable toc scroll') + // always get an array here + const scrollListeners = window.scrollListeners const headings = document.querySelectorAll('h1[id],h2[id],h3[id],h4[id],h5[id]'); const activeClass = 'active'; |
