aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author0neGal <mail@0negal.com>2024-01-24 17:01:33 +0100
committer0neGal <mail@0negal.com>2024-01-24 17:01:33 +0100
commitefe7e75e6f7edaa27caadd4074b3a0c4fa61e7f1 (patch)
tree732448ec281717b6d129b3cef6cf58526e23b117
parent5b3e218d446ac805685e43c8c95ca524755b6601 (diff)
downloadViper-efe7e75e6f7edaa27caadd4074b3a0c4fa61e7f1.tar.gz
Viper-efe7e75e6f7edaa27caadd4074b3a0c4fa61e7f1.zip
fixed preview and filter popup not closing
If you're not clicking inside the `#browser` popup, then the preview and filter popups would stay open, until you do so, or something else causes them to close. This fixes that.
-rw-r--r--src/app/js/browser.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/app/js/browser.js b/src/app/js/browser.js
index 07572d9..b6e3651 100644
--- a/src/app/js/browser.js
+++ b/src/app/js/browser.js
@@ -571,12 +571,12 @@ search.addEventListener("keyup", () => {
let mouse_events = ["scroll", "mousedown", "touchdown"];
mouse_events.forEach((event) => {
- browser.addEventListener(event, () => {
+ document.body.addEventListener(event, () => {
Preview.hide();
- let mouseAt = document.elementsFromPoint(mouseX, mouseY);
- if (! mouseAt.includes(document.querySelector("#filter"))
- && ! mouseAt.includes(document.querySelector(".overlay"))) {
+ let mouse_at = document.elementsFromPoint(mouseX, mouseY);
+ if (! mouse_at.includes(document.querySelector("#filter"))
+ && ! mouse_at.includes(document.querySelector(".overlay"))) {
Browser.filters.toggle(false);
}
})