Skip to content

Commit

Permalink
fixed filters button not being able to be toggled
Browse files Browse the repository at this point in the history
Clicking the filters button would close then reopen it, instead of
closing, then opening when clicking again.
  • Loading branch information
0neGal committed May 20, 2022
1 parent cdab6e7 commit ad7d7a4
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/app/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
})
});

Expand All @@ -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 = ''")
Expand Down

0 comments on commit ad7d7a4

Please sign in to comment.