mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-29 08:57:03 +02:00
parent
9dc5167cd0
commit
7db7fdefcd
1869 changed files with 16821 additions and 5607 deletions
|
@ -54,10 +54,16 @@
|
|||
createToggler('#navToggler', '#docsNav', 'docsSliderActive');
|
||||
createToggler('#tocToggler', 'body', 'tocActive');
|
||||
|
||||
const headings = document.querySelector('.toc-headings');
|
||||
var headings = document.querySelector('.toc-headings');
|
||||
headings && headings.addEventListener('click', function(event) {
|
||||
if (event.target.tagName === 'A') {
|
||||
document.body.classList.remove('tocActive');
|
||||
var el = event.target;
|
||||
while(el !== headings){
|
||||
if (el.tagName === 'A') {
|
||||
document.body.classList.remove('tocActive');
|
||||
break;
|
||||
} else{
|
||||
el = el.parentNode;
|
||||
}
|
||||
}
|
||||
}, false);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue