diff options
author | 0neGal <mail@0negal.com> | 2022-05-20 23:21:39 +0200 |
---|---|---|
committer | 0neGal <mail@0negal.com> | 2022-05-20 23:21:39 +0200 |
commit | ad7d7a4b3d130ec41ce4e8f29728cd2c24fe9b74 (patch) | |
tree | 8d3d1be180deb53bad3061e79601198109c40130 /src/app | |
parent | cdab6e7d543b90cf1e60c74f8d38767bbce7f3a7 (diff) | |
download | Viper-ad7d7a4b3d130ec41ce4e8f29728cd2c24fe9b74.tar.gz Viper-ad7d7a4b3d130ec41ce4e8f29728cd2c24fe9b74.zip |
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.
Diffstat (limited to 'src/app')
-rw-r--r-- | src/app/browser.js | 13 |
1 files changed, 12 insertions, 1 deletions
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 = ''") |