mirror of
https://github.com/docusealco/docuseal
synced 2026-11-04 06:42:32 -05:00
12 lines
370 B
JavaScript
12 lines
370 B
JavaScript
export default class extends HTMLElement {
|
|
connectedCallback () {
|
|
this.id = `menu-active-${Math.random().toString(32).split('.')[1]}`
|
|
|
|
this.querySelectorAll('a').forEach((link) => {
|
|
if (document.location.pathname.startsWith(link.pathname) && !link.getAttribute('href').startsWith('http')) {
|
|
link.classList.add('bg-base-300')
|
|
}
|
|
})
|
|
}
|
|
}
|