forked from ekpono/sentry-my-customer-frontend
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' of https://github.com/hngi/sentry-my-customer-…
…frontend into develop
- Loading branch information
Showing
12 changed files
with
151 additions
and
92 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
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
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,38 @@ | ||
//add event listener for button click | ||
// let search = document.querySelector('.faq-top__btn').addEventListener('click', showFilterResults); | ||
let userText = document.querySelector('#search-faq') | ||
let faqCard = document.querySelectorAll('.card h2') | ||
|
||
//add input event listener | ||
userText.addEventListener('keyup', showFilterResults) | ||
|
||
function showFilterResults(e) { | ||
const faqItem = faqCard; | ||
const filterText = e.target.value.toLowerCase(); | ||
|
||
//console.log(faqItem); | ||
// console.log(filterText); | ||
//console.log(e.target.value) | ||
|
||
faqItem.forEach(function (item) { | ||
if (item.innerText.toLowerCase().indexOf(filterText) !== -1) { | ||
item.parentElement.parentElement.parentElement.classList.remove('dissapear'); | ||
item.parentElement.parentElement.parentElement.classList.add('appear'); | ||
} else { | ||
item.parentElement.parentElement.parentElement.classList.remove('appear'); | ||
item.parentElement.parentElement.parentElement.classList.add('dissapear'); | ||
}; | ||
}); | ||
|
||
let visibles = document.querySelectorAll('.appear') | ||
|
||
if (visibles.length == 0) { | ||
document.querySelector('#faq__accordion').classList.add('dissapear'); | ||
document.querySelector('.nothing-box').style.display = 'flex' | ||
} else { | ||
document.querySelector('#faq__accordion').classList.remove('dissapear'); | ||
document.querySelector('.nothing-box').style.display = 'none' | ||
} | ||
|
||
|
||
}; |
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
Oops, something went wrong.