misc #22

Merged
SethTrowbridge merged 3 commits from misc into master 2023-04-29 06:58:53 -04:00
Showing only changes of commit 4613ff38e2 - Show all commits

View File

@ -78,14 +78,19 @@ export const Router = {
document.addEventListener("click", e=>
{
const t = e.target as HTMLAnchorElement;
if(t.href)
const path = e.composedPath() as HTMLAnchorElement[];
for(let i=0; i<path.length; i++)
{
const u = new URL(t.href);
if(u.origin == document.location.origin)
if(path[i].href)
{
e.preventDefault();
const parts = Router.Parse(u);
routeUpdate(parts.Path, parts.Params, parts.Anchor);
const u = new URL(t.href);
if(u.origin == document.location.origin)
{
e.preventDefault();
const parts = Router.Parse(u);
routeUpdate(parts.Path, parts.Params, parts.Anchor);
}
return;
}
}
})