Skip to content

Commit

Permalink
if an item was selected, ensure it's displayed at the top of the view…
Browse files Browse the repository at this point in the history
…port
  • Loading branch information
JasperCraeghs committed Jan 3, 2024
1 parent c75e8c0 commit 45cfc11
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions mlx/traceability/assets/traceability.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,15 @@ $(document).ready(function () {
$('p.admonition-title').each(function (i) {
$(this).children('a').first().denyPermalinkStyling($(this));
});

// if an item was selected, ensure it's displayed at the top of the viewport
if (location.hash) {
const anchorId = location.hash.slice(1);
const element = document.getElementById(anchorId);
if (element) {
element.scrollIntoView(true, { block: "start", inline: "nearest" });
}
}
});

// item
Expand Down

0 comments on commit 45cfc11

Please sign in to comment.