From ef40ec3a7748f6a186a04bd80c39bb1ea193ca65 Mon Sep 17 00:00:00 2001 From: 0neGal Date: Wed, 24 Jan 2024 17:36:28 +0100 Subject: fixed clicking parts of preview popup closing it --- src/app/js/browser.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src') 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); -- cgit v1.2.3