mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Change variable naming to make more sense
This commit is contained in:
parent
3b813a6849
commit
cbe7ad9a39
@ -76,7 +76,7 @@
|
|||||||
|
|
||||||
{% block js %}
|
{% block js %}
|
||||||
<script>
|
<script>
|
||||||
var cards = []
|
var lines = []
|
||||||
if (localStorage.getItem("words")) {
|
if (localStorage.getItem("words")) {
|
||||||
try {
|
try {
|
||||||
var words = JSON.parse(localStorage.getItem("words"));
|
var words = JSON.parse(localStorage.getItem("words"));
|
||||||
@ -98,7 +98,7 @@
|
|||||||
console.log('Got Log From Server')
|
console.log('Got Log From Server')
|
||||||
$('#virt_console').html(data);
|
$('#virt_console').html(data);
|
||||||
scroll();
|
scroll();
|
||||||
cards = document.querySelectorAll('.box');
|
lines = document.querySelectorAll('.box');
|
||||||
liveSearch();
|
liveSearch();
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@ -130,21 +130,21 @@
|
|||||||
|
|
||||||
//Use innerText if all contents are visible
|
//Use innerText if all contents are visible
|
||||||
//Use textContent for including hidden elements
|
//Use textContent for including hidden elements
|
||||||
for (var i = 0; i < cards.length; i++) {
|
for (var i = 0; i < lines.length; i++) {
|
||||||
if (words.length > 0) {
|
if (words.length > 0) {
|
||||||
let flag = false;
|
let flag = false;
|
||||||
for (var k = 0; k < words.length; k++) {
|
for (var k = 0; k < words.length; k++) {
|
||||||
if (cards[i].textContent.toLowerCase().includes(words[k])) {
|
if (lines[i].textContent.toLowerCase().includes(words[k])) {
|
||||||
flag = true;
|
flag = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!flag) {
|
if (!flag) {
|
||||||
cards[i].classList.remove("is-hidden");
|
lines[i].classList.remove("is-hidden");
|
||||||
} else {
|
} else {
|
||||||
cards[i].classList.add("is-hidden");
|
lines[i].classList.add("is-hidden");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
cards[i].classList.remove("is-hidden");
|
lines[i].classList.remove("is-hidden");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user