From 50a9106b6c72a97aee9d6c430c1b3dac81ee5d3e Mon Sep 17 00:00:00 2001 From: jeffreytse Date: Sun, 12 Jul 2020 16:19:42 +0800 Subject: feat: change article menu style --- _includes/sidebar/article-menu.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to '_includes/sidebar') 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 @@
-
Contents
+
TOC
@@ -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'); } -- cgit v1.2.3