summaryrefslogtreecommitdiff
path: root/_includes
diff options
context:
space:
mode:
authorjeffreytse <jeffreytse.mail@gmail.com>2020-07-12 16:19:42 +0800
committerjeffreytse <jeffreytse.mail@gmail.com>2020-07-12 16:19:42 +0800
commit50a9106b6c72a97aee9d6c430c1b3dac81ee5d3e (patch)
tree0545f38052034f324348d5bc40d6446edc3c2fe4 /_includes
parentb83c3ac2377deab05c7c80fb9c06718971e2bfb9 (diff)
feat: change article menu style
Diffstat (limited to '_includes')
-rw-r--r--_includes/sidebar/article-menu.html5
1 files changed, 3 insertions, 2 deletions
diff --git a/_includes/sidebar/article-menu.html b/_includes/sidebar/article-menu.html
index ff984b6..96a4968 100644
--- a/_includes/sidebar/article-menu.html
+++ b/_includes/sidebar/article-menu.html
@@ -7,7 +7,7 @@
</style>
<div class="post-menu">
- <div class="post-menu-title">Contents</div>
+ <div class="post-menu-title">TOC</div>
<div class="post-menu-content"></div>
</div>
@@ -49,7 +49,8 @@
var headerHeight = headerTop + headerHeight + 20;
if (headingRect.top <= headerHeight) {
var id = 'h-' + h.getAttribute('id');
- var curActive = menuContent.querySelector('a[href="#' + id + '"]');
+ var a = menuContent.querySelector('a[href="#' + id + '"]');
+ var curActive = a.parentNode;
if (curActive) {
curActive.classList.add('active');
}