mirror of
https://github.com/FoxxMD/multi-scrobbler.git
synced 2026-10-28 17:42:19 +00:00
13 lines
687 B
JavaScript
13 lines
687 B
JavaScript
// starlight-codeblocks' client loader re-scans the page on Astro's page-load event
|
|
export function onRouteDidUpdate() {
|
|
document.dispatchEvent(new Event('astro:page-load'));
|
|
}
|
|
|
|
if (typeof document !== 'undefined') {
|
|
// Docusaurus' <details> (theme-common Details) calls stopPropagation() on every click inside it, so clicks
|
|
// on code tabs never reach the `document` listener that starlight-codeblocks switches tabs with.
|
|
// Tab clicks are never summary clicks, so letting them through cannot toggle any <details>.
|
|
document.addEventListener('click', (event) => {
|
|
if (event.target.closest?.('.scb-tabs-list > [role="tab"]')) event.stopPropagation = () => {};
|
|
}, true);
|
|
}
|