From e5b26689a2291eaa1773de58bb534a6d81fb00bd Mon Sep 17 00:00:00 2001 From: Dan Allen Date: Sun, 20 Dec 2020 17:36:13 -0700 Subject: [PATCH] use test instead of match when looking for section in nav script --- src/js/01-nav.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/01-nav.js b/src/js/01-nav.js index 0b4c5bf..2b66741 100644 --- a/src/js/01-nav.js +++ b/src/js/01-nav.js @@ -58,7 +58,7 @@ while ((current = current.parentNode) && current !== ceiling) { var id = current.id // NOTE: look for section heading - if (!id && (id = current.className.match(SECT_CLASS_RX))) id = (current.firstElementChild || {}).id + if (!id && (id = SECT_CLASS_RX.test(current.className))) id = (current.firstElementChild || {}).id if (id && (navLink = menuPanel.querySelector('.nav-link[href="#' + id + '"]'))) break } } -- 2.11.0