From ad7d7a4b3d130ec41ce4e8f29728cd2c24fe9b74 Mon Sep 17 00:00:00 2001 From: 0neGal Date: Fri, 20 May 2022 23:21:39 +0200 Subject: fixed filters button not being able to be toggled Clicking the filters button would close then reopen it, instead of closing, then opening when clicking again. --- src/app/browser.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/app/browser.js b/src/app/browser.js index fea9dec..7afce22 100644 --- a/src/app/browser.js +++ b/src/app/browser.js @@ -437,7 +437,11 @@ let events = ["scroll", "mousedown", "touchdown"]; events.forEach((event) => { browser.addEventListener(event, () => { Preview.hide(); - Browser.filters.toggle(false); + + let mouseAt = document.elementsFromPoint(mouseX, mouseY); + if (! mouseAt.includes(document.querySelector("#filter"))) { + Browser.filters.toggle(false); + } }) }); @@ -462,6 +466,13 @@ view.addEventListener("did-start-loading", () => { view.classList.add("loading"); }) +let mouseY = 0; +let mouseX = 0; +browser.addEventListener("mousemove", (event) => { + mouseY = event.clientY; + mouseX = event.clientX; +}) + let checks = document.querySelectorAll(".check"); for (let i = 0; i < checks.length; i++) { checks[i].setAttribute("onclick", "this.classList.toggle('checked');Browser.loadfront();search.value = ''") -- cgit v1.2.3