Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions doc/api_assets/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,20 @@
});
}

function setupSidebarScroll() {
const sidebarLinks = document.querySelectorAll('#column2 a');

let link;
for (link of sidebarLinks) {
if (link.pathname === window.location.pathname) break;
}

if (!link) return;

link.scrollIntoView({ block: 'center' });
}


function bootstrap() {
// Check if we have JavaScript support.
document.documentElement.classList.add('has-js');
Expand All @@ -206,6 +220,8 @@
setupFlavorToggles();

setupCopyButton();

setupSidebarScroll();
}

if (document.readyState === 'loading') {
Expand Down
Loading