From 107a9a4c390877828cdf5089a9417d0e2cc5c0da Mon Sep 17 00:00:00 2001 From: liquidev Date: Sat, 23 Nov 2024 22:49:58 +0100 Subject: [PATCH] restore functionality that expands linked branches --- static/js/tree.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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"); } }