assets/js/just-the-docs.js in just-the-docs-0.6.1 vs assets/js/just-the-docs.js in just-the-docs-0.6.2
- old
+ new
@@ -29,14 +29,11 @@
while (target && !(target.classList && target.classList.contains('nav-list-expander'))) {
target = target.parentNode;
}
if (target) {
e.preventDefault();
- const active = target.parentNode.classList.toggle('active');
- const passive = target.parentNode.classList.toggle('passive');
- if (active && passive) target.parentNode.classList.toggle('passive');
- target.ariaPressed = active;
+ target.ariaPressed = target.parentNode.classList.toggle('active');
}
});
const siteNav = document.getElementById('site-nav');
const mainHeader = document.getElementById('main-header');
@@ -496,12 +493,11 @@
document.getElementById('site-nav').scrollBy(0, rect.top - 3*rect.height);
}
}
// Find the nav-list-link that refers to the current page
-// then make it and all enclosing nav-list-item elements active,
-// and make all other folded collections passive
+// then make it and all enclosing nav-list-item elements active.
function activateNav() {
var target = navLink();
if (target) {
target.classList.toggle('active', true);
@@ -511,20 +507,9 @@
target = target.parentNode;
}
if (target) {
target.classList.toggle('active', true);
target = target.parentNode;
- }
- }
- const elements = document.getElementsByClassName("nav-category-list");
- for (const element of elements) {
- const item = element.children[0];
- const active = item.classList.toggle('active');
- if (active) {
- item.classList.toggle('active', false);
- item.classList.toggle('passive', true);
- } else {
- item.classList.toggle('active', true);
}
}
}
// Document ready