mirror of
https://github.com/snachodog/just-the-docs.git
synced 2025-04-18 17:12:23 -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:
parent
2b434e5f82
commit
0964e1f8ae
@ -17,8 +17,10 @@ This website is built from the `HEAD` of the `main` branch of the theme reposito
|
|||||||
|
|
||||||
Code changes to `main` that are *not* in the latest release:
|
Code changes to `main` that are *not* in the latest release:
|
||||||
|
|
||||||
|
- Remove: unused `.passive` toggle in navigation by [@pdmosses] in [#1335]
|
||||||
- Fixed: Windows emoji font fallback by [@flanakin] in [#1337]
|
- Fixed: Windows emoji font fallback by [@flanakin] in [#1337]
|
||||||
|
|
||||||
|
[#1335]: https://github.com/just-the-docs/just-the-docs/pull/1335
|
||||||
[#1337]: https://github.com/just-the-docs/just-the-docs/pull/1337
|
[#1337]: https://github.com/just-the-docs/just-the-docs/pull/1337
|
||||||
|
|
||||||
### New Contributors
|
### New Contributors
|
||||||
|
@ -134,11 +134,10 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Styling for nav-list-expanders at first and second levels,
|
// Styling for nav-list-expanders at first and second levels:
|
||||||
// suppressed when a click has deactivated the expander (making the nav-list-item .passive):
|
|
||||||
{{ activation_collection_prefix }} {
|
{{ activation_collection_prefix }} {
|
||||||
> .nav-list-item:not(.passive):nth-child({{ activation_first_level_index }}){%- if activation_second_level_index %},
|
> .nav-list-item:nth-child({{ activation_first_level_index }}){%- if activation_second_level_index %},
|
||||||
> .nav-list-item:not(.passive):nth-child({{ activation_first_level_index }}) > .nav-list > .nav-list-item:not(.passive):nth-child({{ activation_second_level_index }}){% endif %} {
|
> .nav-list-item:nth-child({{ activation_first_level_index }}) > .nav-list > .nav-list-item:nth-child({{ activation_second_level_index }}){% endif %} {
|
||||||
> .nav-list-expander svg {
|
> .nav-list-expander svg {
|
||||||
@if $nav-list-expander-right {
|
@if $nav-list-expander-right {
|
||||||
transform: rotate(-90deg);
|
transform: rotate(-90deg);
|
||||||
@ -154,7 +153,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Styling for nav-list-expander for categories:
|
// Styling for nav-list-expander for categories:
|
||||||
.site-nav > .nav-category-list > .nav-list-item:not(.passive) {
|
.site-nav > .nav-category-list > .nav-list-item {
|
||||||
> .nav-list-expander svg {
|
> .nav-list-expander svg {
|
||||||
@if $nav-list-expander-right {
|
@if $nav-list-expander-right {
|
||||||
transform: rotate(-90deg);
|
transform: rotate(-90deg);
|
||||||
|
@ -31,10 +31,7 @@ function initNav() {
|
|||||||
}
|
}
|
||||||
if (target) {
|
if (target) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
const active = target.parentNode.classList.toggle('active');
|
target.ariaPressed = target.parentNode.classList.toggle('active');
|
||||||
const passive = target.parentNode.classList.toggle('passive');
|
|
||||||
if (active && passive) target.parentNode.classList.toggle('passive');
|
|
||||||
target.ariaPressed = active;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -498,8 +495,7 @@ function scrollNav() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Find the nav-list-link that refers to the current page
|
// Find the nav-list-link that refers to the current page
|
||||||
// then make it and all enclosing nav-list-item elements active,
|
// then make it and all enclosing nav-list-item elements active.
|
||||||
// and make all other folded collections passive
|
|
||||||
|
|
||||||
function activateNav() {
|
function activateNav() {
|
||||||
var target = navLink();
|
var target = navLink();
|
||||||
@ -515,17 +511,6 @@ function activateNav() {
|
|||||||
target = target.parentNode;
|
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
|
// Document ready
|
||||||
|
Loading…
x
Reference in New Issue
Block a user