Skip to content

Commit 09d5ce6

Browse files
committed
use test instead of match when looking for section in nav script
1 parent 8bdd9c9 commit 09d5ce6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/js/01-nav.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
while ((current = current.parentNode) && current !== ceiling) {
5959
var id = current.id
6060
// NOTE: look for section heading
61-
if (!id && (id = current.className.match(SECT_CLASS_RX))) id = (current.firstElementChild || {}).id
61+
if (!id && (id = SECT_CLASS_RX.test(current.className))) id = (current.firstElementChild || {}).id
6262
if (id && (navLink = menuPanel.querySelector('.nav-link[href="#' + id + '"]'))) break
6363
}
6464
}

0 commit comments

Comments
 (0)