diff --git a/static/js/tree.js b/static/js/tree.js index e1007e0..1c58aca 100644 --- a/static/js/tree.js +++ b/static/js/tree.js @@ -168,9 +168,15 @@ function getCurrentlyHighlightedBranch() { async function highlightCurrentBranch() { let branch = document.getElementById(getCurrentlyHighlightedBranch()); if (branch != null) { - expandDetailsRecursively(branch); - branch.classList.add("target"); branch.scrollIntoView(); + + // Expand the linked branch so that the person entering the link doesn't have to click on it. + expandDetailsRecursively(branch); + if (branch.children.length > 0 && branch.children[0].tagName == "DETAILS") { + expandDetailsRecursively(branch.children[0]); + } + + branch.classList.add("target"); } }