Skip to content

Commit

Permalink
docs: update bt
Browse files Browse the repository at this point in the history
  • Loading branch information
soulgalore committed Feb 14, 2025
1 parent c32b32a commit eaac8d2
Show file tree
Hide file tree
Showing 12 changed files with 936 additions and 598 deletions.
4 changes: 2 additions & 2 deletions docs/documentation/sitespeed.io/scripting/Actions.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/documentation/sitespeed.io/scripting/Measure.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/documentation/sitespeed.io/scripting/Wait.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/documentation/sitespeed.io/scripting/data/search.json

Large diffs are not rendered by default.

24 changes: 24 additions & 0 deletions docs/documentation/sitespeed.io/scripting/scripts/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,29 @@ function addHrefToSidebarTitle() {
});
}

function highlightActiveLinkInSidebar() {
const list = document.location.href.split('/');
const targetURL = decodeURI(list[list.length - 1]);
let element = document.querySelector(`.sidebar a[href*='${targetURL}']`);

if (!element) {
try {
element = document.querySelector(
`.sidebar a[href*='${targetURL.split('#')[0]}']`
);
} catch (e) {
console.error(e);

return;
}
}

if (!element) return;

element.parentElement.classList.add('active');
element.scrollIntoView();
}

function onDomContentLoaded() {
var themeButton = document.querySelectorAll('.theme-toggle');

Expand Down Expand Up @@ -676,6 +699,7 @@ function onDomContentLoaded() {
initTooltip();
fixTable();
addHrefToSidebarTitle();
highlightActiveLinkInSidebar();
}

// eslint-disable-next-line no-undef
Expand Down
46 changes: 23 additions & 23 deletions docs/documentation/sitespeed.io/scripting/scripts/core.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit eaac8d2

Please sign in to comment.