Skip to content

Commit

Permalink
Update htmlv2.pug
Browse files Browse the repository at this point in the history
Update htmlv2.pug
Updated how top and bottom controllers activate and deactivate in html.

Use event.composedPath() instead of event.path.find(), which didn't work.
  • Loading branch information
sipsuru authored Nov 26, 2024
1 parent ca66159 commit fd12c7b
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions templates/htmlv2.pug
Original file line number Diff line number Diff line change
Expand Up @@ -228,13 +228,11 @@ script.
}

window.addEventListener("click", (event) => {

if(!event.path.find((el) => el.id === "top-control" || el.id === "bottom-control")){
document.querySelector("#top-control").classList.toggle("active");
document.querySelector("#bottom-control").classList.toggle("active");
}

});
if (!event.composedPath().some((el) => el.id === "top-control" || el.id === "bottom-control")) {
document.querySelector("#top-control").classList.toggle("active");
document.querySelector("#bottom-control").classList.toggle("active");
}
});

let isScrolling;

Expand Down

0 comments on commit fd12c7b

Please sign in to comment.