feat(glossaire): enrichir navigation intelligente des paradigmes
This commit is contained in:
@@ -91,15 +91,6 @@ const hasFlows = flows.length > 0;
|
||||
background: rgba(127,127,127,0.045);
|
||||
}
|
||||
|
||||
.glossary-smart-nav__eyebrow{
|
||||
margin-bottom: 8px;
|
||||
font-size: 12px;
|
||||
font-weight: 850;
|
||||
letter-spacing: .06em;
|
||||
text-transform: uppercase;
|
||||
opacity: .72;
|
||||
}
|
||||
|
||||
.glossary-smart-nav__primary{
|
||||
display: grid;
|
||||
gap: 5px;
|
||||
@@ -291,19 +282,26 @@ const hasFlows = flows.length > 0;
|
||||
|
||||
<script is:inline>
|
||||
(() => {
|
||||
document
|
||||
.querySelectorAll(".glossary-smart-nav__path-button")
|
||||
.forEach((button) => {
|
||||
button.addEventListener("click", () => {
|
||||
const panelId = button.getAttribute("aria-controls");
|
||||
const panel = panelId ? document.getElementById(panelId) : null;
|
||||
if (!panel) return;
|
||||
document.querySelectorAll(".glossary-smart-nav").forEach((nav) => {
|
||||
nav
|
||||
.querySelectorAll(".glossary-smart-nav__path-button")
|
||||
.forEach((button) => {
|
||||
button.addEventListener("click", () => {
|
||||
const panelId = button.getAttribute("aria-controls");
|
||||
const panel = panelId ? document.getElementById(panelId) : null;
|
||||
if (!panel || !nav.contains(panel)) return;
|
||||
|
||||
const expanded = button.getAttribute("aria-expanded") === "true";
|
||||
const expanded = button.getAttribute("aria-expanded") === "true";
|
||||
const nextExpanded = !expanded;
|
||||
|
||||
button.setAttribute("aria-expanded", expanded ? "false" : "true");
|
||||
panel.hidden = expanded;
|
||||
button.setAttribute("aria-expanded", nextExpanded ? "true" : "false");
|
||||
panel.hidden = !nextExpanded;
|
||||
|
||||
button
|
||||
.closest(".glossary-smart-nav__path")
|
||||
?.classList.toggle("is-open", nextExpanded);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user