mirror of
https://github.com/snachodog/just-the-docs.git
synced 2025-09-12 21:03:32 -06:00
Remove the passive
toggle (#1335)
* Remove "passive" toggle PR #1244 introduced the "passive" toggle, but just-the-docs.js subsequently disabled the only styling that used it, so it became redundant. This removes it. * Update CHANGELOG.md * Update CHANGELOG.md Co-authored-by: Matt Wang <matt@matthewwang.me> * Update CHANGELOG.md Co-authored-by: Matt Wang <matt@matthewwang.me> --------- Co-authored-by: Matt Wang <matt@matthewwang.me>
This commit is contained in:
@@ -31,10 +31,7 @@ function initNav() {
|
||||
}
|
||||
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');
|
||||
}
|
||||
});
|
||||
|
||||
@@ -498,8 +495,7 @@ function scrollNav() {
|
||||
}
|
||||
|
||||
// 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();
|
||||
@@ -515,17 +511,6 @@ function activateNav() {
|
||||
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
|
||||
|
Reference in New Issue
Block a user