Skip to content

armgit / my-yt

Public Imported from GitHub
0

A clean and minimal youtube frontend, without all the ads and whistles

JavaScript

fix: improve searching for videos, show ignored ones too

Christian Feie5c754cc6b97
diff --git a/client/components/search-videos.js b/client/components/search-videos.js
index 166ff97..8f3870e 100644
--- a/client/components/search-videos.js
+++ b/client/components/search-videos.js
@@ -27,8 +27,10 @@ class SearchVideos extends HTMLElement {
if (!searchTerm) {
if ($status) $status.innerText = ''
$videos.forEach($video => $video.style.display = '')
+ document.body.classList.remove('searching')
return console.log('no search term')
}
+ document.body.classList.add('searching')
let filteredCount = 0
$videos.forEach($video => {
const videoData = JSON.parse($video.dataset['data'])
diff --git a/client/main.css b/client/main.css
index 7f49aa5..ae6f16e 100644
--- a/client/main.css
+++ b/client/main.css
@@ -380,6 +380,9 @@ details {
padding: 0.5rem;
}
+body.searching [data-ignored="true"] {
+ display: block;
+}
[data-ignored="true"] {
display: none;
}