projects
/
eg-antora.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6e5903c
)
use test instead of match when looking for section in nav script
author
Dan Allen
<dan@opendevise.com>
Mon, 21 Dec 2020 00:36:13 +0000
(17:36 -0700)
committer
Dan Allen
<dan@opendevise.com>
Mon, 21 Dec 2020 00:36:13 +0000
(17:36 -0700)
src/js/01-nav.js
patch
|
blob
|
history
diff --git
a/src/js/01-nav.js
b/src/js/01-nav.js
index
0b4c5bf
..
2b66741
100644
(file)
--- 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
}
}