projects
/
brackets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use more widely supported forEach style
[brackets.git]
/
frontend
/
index.js
diff --git
a/frontend/index.js
b/frontend/index.js
index
bd10105
..
c46676d
100644
(file)
--- a/
frontend/index.js
+++ b/
frontend/index.js
@@
-133,9
+133,7
@@
window.onload = () => {
genreInput.addEventListener("input", (e) => {
const input = e.target;
genreInput.addEventListener("input", (e) => {
const input = e.target;
- for (const item of genreList.children) {
- item.style.display = item.dataset.name.includes(input.value.toLowerCase()) ? "block" : "none";
- }
+ Array.from(genreList.children).forEach((item) => item.style.display= item.dataset.name.includes(input.value.toLowerCase()) ? "block" : "none");
});
genreInput.addEventListener("focus", (e) => {
genreList.style.display = "block";
});
genreInput.addEventListener("focus", (e) => {
genreList.style.display = "block";