aboutsummaryrefslogtreecommitdiff
path: root/src/app/js
diff options
context:
space:
mode:
author0neGal <mail@0negal.com>2024-01-24 17:36:28 +0100
committer0neGal <mail@0negal.com>2024-01-24 17:36:28 +0100
commitef40ec3a7748f6a186a04bd80c39bb1ea193ca65 (patch)
tree9ae5e7af7266d4c08764c5fd4720f1bfcbec8f26 /src/app/js
parent23d5018310caf06007bd4b60af1f78614244af25 (diff)
downloadViper-ef40ec3a7748f6a186a04bd80c39bb1ea193ca65.tar.gz
Viper-ef40ec3a7748f6a186a04bd80c39bb1ea193ca65.zip
fixed clicking parts of preview popup closing it
Diffstat (limited to 'src/app/js')
-rw-r--r--src/app/js/browser.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/app/js/browser.js b/src/app/js/browser.js
index b6e3651..d6034eb 100644
--- a/src/app/js/browser.js
+++ b/src/app/js/browser.js
@@ -571,10 +571,13 @@ search.addEventListener("keyup", () => {
let mouse_events = ["scroll", "mousedown", "touchdown"];
mouse_events.forEach((event) => {
- document.body.addEventListener(event, () => {
- Preview.hide();
-
+ document.body.addEventListener(event, (e) => {
let mouse_at = document.elementsFromPoint(mouseX, mouseY);
+
+ if (! mouse_at.includes(document.querySelector("#preview"))) {
+ Preview.hide();
+ }
+
if (! mouse_at.includes(document.querySelector("#filter"))
&& ! mouse_at.includes(document.querySelector(".overlay"))) {
Browser.filters.toggle(false);