🚀 fix: tocbot warning
This commit is contained in:
parent
085292ac1d
commit
c1cedb6104
@ -17,7 +17,7 @@
|
|||||||
</script>
|
</script>
|
||||||
<% } %>
|
<% } %>
|
||||||
|
|
||||||
<% if (theme.toc && is_post()){ %>
|
<% if (theme.toc && is_post() && !page.no_toc){ %>
|
||||||
<%- js('/js/tocbot.min') %>
|
<%- js('/js/tocbot.min') %>
|
||||||
<script>
|
<script>
|
||||||
// Tocbot_v4.7.0 http://tscanlin.github.io/tocbot/
|
// Tocbot_v4.7.0 http://tscanlin.github.io/tocbot/
|
||||||
@ -30,13 +30,7 @@
|
|||||||
scrollContainer: 'main',
|
scrollContainer: 'main',
|
||||||
positionFixedSelector: '.tocbot',
|
positionFixedSelector: '.tocbot',
|
||||||
positionFixedClass: 'is-position-fixed',
|
positionFixedClass: 'is-position-fixed',
|
||||||
fixedSidebarOffset: 'auto',
|
fixedSidebarOffset: 'auto'
|
||||||
onClick: (e) => {
|
|
||||||
$('.toc-link').removeClass('is-active-link');
|
|
||||||
$(`a[href=${e.target.hash}]`).addClass('is-active-link');
|
|
||||||
$(e.target.hash).scrollIntoView();
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<% } %>
|
<% } %>
|
||||||
|
Loading…
Reference in New Issue
Block a user