docs/source/javascripts/sidebar.js
function activeLinks(sidebarContainer) {
  const linksContainer = sidebarContainer.querySelector('ul');

  linksContainer.addEventListener('click', e => {
    if (e.target.tagName === 'A') {
      Array.from(linksContainer.querySelectorAll('a')).forEach(item =>
        item.classList.remove('active')
      );
      e.target.classList.add('active');
    }
  });
}
function activeLinks(sidebarContainer) {
  const linksContainer = sidebarContainer.querySelector('ul');

  linksContainer.addEventListener('click', e => {
    if (e.target.tagName === 'A') {
      Array.from(linksContainer.querySelectorAll('a')).forEach(item =>
        item.classList.remove('active')
      );
      e.target.classList.add('active');
    }
  });
}
function activeLinks ( sidebarContainer ) { const linksContainer = sidebarContainer . querySelector ( 'ul' ) ; linksContainer . addEventListener ( 'click' , e => { if ( e . target . tagName === 'A' ) { Array . from ( linksContainer . querySelectorAll ( 'a' ) ) . forEach ( item => item . classList . remove ( 'active' ) ) ; e . target . classList . add ( 'active' ) ; } } ) ; }
The Following code is used to set active items On the documentation sidebar depending on the clicked item
The Following code is used to set active items On the documentation sidebar depending on the clicked item