forked from tangled.org/core
Monorepo for Tangled

appview/layouts/fragments: add javascript to set aria-current on dropdown links

besaid.zone 7ca3fbfb b2e18169

verified
Changed files
+9
appview
pages
templates
layouts
fragments
+9
appview/pages/templates/layouts/fragments/topbar.html
··· 112 112 } 113 113 }); 114 114 }); 115 + 116 + const navigationPopoverLinks = document.querySelectorAll("#navigation-menu-popover li a"); 117 + const currentPageURL = window.location.href 118 + navigationPopoverLinks.forEach(link => { 119 + const navigationPopoverLinkURL = link.href 120 + if (navigationPopoverLinkURL === currentPageURL) { 121 + link.ariaCurrent = "page" 122 + } 123 + }) 115 124 </script> 116 125 {{ end }}