Skip to content

Commit 70d8dac

Browse files
Expand details of selected member
1 parent 656d3c8 commit 70d8dac

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

docs/content/fsdocs-theme.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,18 @@ if (activeItem && mainMenu) {
1212
scrollToActiveItem(activeItem);
1313
}
1414

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

24+
scrollToAndExpandSelectedMember();
25+
addEventListener('hashchange', _event => scrollToAndExpandSelectedMember());
26+
2027
if(location.pathname.startsWith('/reference/')) {
2128
// Scroll to API Reference header
2229
const navHeaders = document.querySelectorAll(".nav-header");

0 commit comments

Comments
 (0)