Merge pull request 'fix: keep glossary entry details open on compact viewports' (#325) from fix/glossary-entry-mobile-details into main
All checks were successful
Proposer Apply (Queue) / apply-proposer (push) Successful in 25s
CI / build-and-anchors (push) Successful in 35s
SMOKE / smoke (push) Successful in 8s
Deploy staging+live (annotations) / deploy (push) Successful in 9m4s

Reviewed-on: #325
This commit was merged in pull request #325.
This commit is contained in:
2026-04-26 12:10:17 +00:00

View File

@@ -2718,6 +2718,16 @@ const WHOAMI_FORCE_LOCALHOST = (import.meta.env.PUBLIC_WHOAMI_FORCE_LOCALHOST ??
const isGlossaryCompactViewport = () =>
isGlossaryEdition &&
(mqGlossaryCompact.matches || mqGlossaryCompactLandscape.matches);
function forceOpenGlossaryEntryDetails() {
if (!isGlossaryEntryMode || !reading) return;
reading.querySelectorAll("details.details-section").forEach((details) => {
details.open = true;
});
}
forceOpenGlossaryEntryDetails();
function disableFollowForCompactGlossary() {
followEl.classList.remove("is-on");
@@ -2745,16 +2755,11 @@ const WHOAMI_FORCE_LOCALHOST = (import.meta.env.PUBLIC_WHOAMI_FORCE_LOCALHOST ??
}
if (isGlossaryHomeMode || isGlossaryCompactViewport()) {
forceOpenGlossaryEntryDetails();
disableFollowForCompactGlossary();
return;
}
if (isGlossaryEntryMode) {
reading.querySelectorAll("details.details-section").forEach((details) => {
details.open = true;
});
}
const h1 = reading.querySelector("h1");
const topChapterLabel =