-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #92 from findify/FI-7918/perfomance-updates
Perfomance and ADA updates
- Loading branch information
Showing
7 changed files
with
63 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
const filterSearch = (filter_group_id, input_id) => { | ||
const filterSelector = '.findify-filters-checkbox-item'; | ||
const filterTextSelector = 'label'; | ||
|
||
const filterGroupElement = document.getElementById(filter_group_id); | ||
const filters = filterGroupElement.querySelectorAll(filterSelector); | ||
const input = document.getElementById(input_id); | ||
|
||
const inputHandler = (e) => { | ||
const value = e.target.value.trim().toLowerCase(); | ||
filters.forEach(item => { | ||
const text = item.querySelector(filterTextSelector).innerText.trim().toLowerCase(); | ||
const shouldHide = value && !text.includes(value); | ||
item.setAttribute("aria-hidden", shouldHide.toString()); | ||
}); | ||
}; | ||
|
||
input.addEventListener("input", inputHandler); | ||
}; | ||
|
||
const collapseFilter = (element_id) => { | ||
const filterGroupElement = document.getElementById(element_id); | ||
const [header, body] = filterGroupElement.querySelectorAll('div'); | ||
|
||
const headerClickHandler = (e) => { | ||
e.preventDefault(); | ||
const isOpen = body.getAttribute("data-opened") === "true"; | ||
body.setAttribute("data-opened", (!isOpen).toString()); | ||
}; | ||
|
||
header.addEventListener("click", headerClickHandler); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters