aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
author0neGal <mail@0negal.com>2022-05-20 23:21:39 +0200
committer0neGal <mail@0negal.com>2022-05-20 23:21:39 +0200
commitad7d7a4b3d130ec41ce4e8f29728cd2c24fe9b74 (patch)
tree8d3d1be180deb53bad3061e79601198109c40130 /src
parentcdab6e7d543b90cf1e60c74f8d38767bbce7f3a7 (diff)
downloadViper-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')
-rw-r--r--src/app/browser.js13
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 = ''")