diff --git a/templates/htmlv2.pug b/templates/htmlv2.pug
index 43ebf2d..78d0f12 100644
--- a/templates/htmlv2.pug
+++ b/templates/htmlv2.pug
@@ -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;