diff --git a/modules/app.xqm b/modules/app.xqm index af8532484..124ad58b1 100644 --- a/modules/app.xqm +++ b/modules/app.xqm @@ -134,6 +134,11 @@ declare let $subsubFacets := $coll => ft:facets("chronology", (), ($label,$subLabel)) return + { + if(($label,$subLabel) => string-join() = $activeLabelString) + then attribute class {'active'} + else () + } { if (map:size($subsubFacets) gt 0) @@ -143,10 +148,7 @@ declare ) else() } - {$subLabel} + {$subLabel} {$count} { diff --git a/resources/js/init.js b/resources/js/init.js index 660cd3b7f..0d559cdd4 100644 --- a/resources/js/init.js +++ b/resources/js/init.js @@ -296,12 +296,17 @@ $('body').on('click touchstart', function (e) { * hide/reveal sub items of the table of contents of the Guidelines and Wikipedia */ $('.toggle-toc-item') - .on('click', toggleTocItems) - .each(toggleTocItems); + .on('click', toggleTocItems) /* toggle on click */ + .each(toggleTocItems); /* initially collapse all */ $('.toc a[href~="'+window.location.pathname+window.location.hash+'"]').parentsUntil(".guidelines").addClass("active"); $('.appendix a[href^="'+window.location.pathname+window.location.hash+'"]').parentsUntil(".appendix-div").addClass("active"); $(".toc .active").siblings(".toggle-toc-item").each(toggleTocItems); +/* initially open selected chronology facets */ +/* … along the ancestor axis */ +$('.datefacets li.active').parentsUntil('.datefacets', 'li').children('.toggle-toc-item').each(toggleTocItems); +/* … and the (direct) child axis */ +$('.datefacets li.active').children('.toggle-toc-item').each(toggleTocItems); /* * used for Guidelines TOC as well as for Wikipedia diff --git a/resources/sass/layout/_sidebar.scss b/resources/sass/layout/_sidebar.scss index f5d64ecc4..a5daee8f8 100644 --- a/resources/sass/layout/_sidebar.scss +++ b/resources/sass/layout/_sidebar.scss @@ -143,6 +143,9 @@ a.checkbox-only { align-items: start; cursor: pointer; color: $primary; + &:has(.label.active) { + font-weight: 800; + } .label { flex: 1; }