Skip to content

Commit

Permalink
fix: h3 topics with Markdown formatting causes a glitch on mobile (#1467
Browse files Browse the repository at this point in the history
)

* fixed h3 topics with Markdown formatting causes a glitch on mobile

* replaced currenttarget to headings for if check

* use var instead of es6
  • Loading branch information
shakcho authored and endiliey committed May 18, 2019
1 parent 79b5ffd commit 084a498
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions packages/docusaurus-1.x/lib/core/nav/SideNav.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,16 @@ class SideNav extends React.Component {
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);
Expand Down

0 comments on commit 084a498

Please sign in to comment.