Skip to content

Commit

Permalink
Expand details of selected member
Browse files Browse the repository at this point in the history
  • Loading branch information
brianrourkeboll committed May 24, 2024
1 parent 656d3c8 commit 70d8dac
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions docs/content/fsdocs-theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,18 @@ if (activeItem && mainMenu) {
scrollToActiveItem(activeItem);
}

if(location.hash) {
const header = document.querySelector(`a[href='${location.hash}']`);
header.scrollIntoView({ behavior: 'instant'});
function scrollToAndExpandSelectedMember() {
if (location.hash) {
const header = document.querySelector(`a[href='${location.hash}']`);
header.scrollIntoView({ behavior: 'instant'});
const details = document.querySelector(`tr > td.fsdocs-member-usage:has(a[href='${location.hash}']) ~ td.fsdocs-member-xmldoc > details`);
details?.setAttribute('open', 'true');
}
}

scrollToAndExpandSelectedMember();
addEventListener('hashchange', _event => scrollToAndExpandSelectedMember());

if(location.pathname.startsWith('/reference/')) {
// Scroll to API Reference header
const navHeaders = document.querySelectorAll(".nav-header");
Expand Down

0 comments on commit 70d8dac

Please sign in to comment.