Fix state filter removing video cards.

This commit is contained in:
voussoir 2022-01-17 15:50:33 -08:00
parent 0239ae6b76
commit 134bcb5a87
No known key found for this signature in database
GPG key ID: 5F7554F8C26DACCB

View file

@ -339,12 +339,12 @@ function filter_video_cards(search_term)
video_card_list.classList.add("hidden"); video_card_list.classList.add("hidden");
const search_term_lower = search_term.toLocaleLowerCase(); const search_term_lower = search_term.toLocaleLowerCase();
const state_class = "video_card_" + STATE; const state_class = "video_card_" + STATE;
const video_cards = Array.from(video_card_list.getElementsByClassName("video_card")) const video_cards = Array.from(video_card_list.getElementsByClassName("video_card"));
video_cards.forEach(function(video_card) video_cards.forEach(function(video_card)
{ {
if (STATE && !video_card.classList.contains(state_class)) if (STATE && !video_card.classList.contains(state_class))
{ {
video_cards.removeChild(video_card); video_card_list.removeChild(video_card);
return; return;
} }
const title_lower = video_card.getElementsByClassName("video_title")[0].innerText.toLocaleLowerCase(); const title_lower = video_card.getElementsByClassName("video_title")[0].innerText.toLocaleLowerCase();