Files
docuseal/app/javascript/elements/menu_active.js
T

10 lines
297 B
JavaScript
Raw Normal View History

2023-05-30 00:55:14 +03:00
export default class extends HTMLElement {
connectedCallback () {
this.querySelectorAll('a').forEach((link) => {
2023-08-05 21:39:59 +03:00
if (document.location.pathname.startsWith(link.pathname) && !link.getAttribute('href').startsWith('http')) {
2023-05-30 00:55:14 +03:00
link.classList.add('bg-base-300')
}
})
}
}