riddhiman commited on
Commit
6c29de6
·
verified ·
1 Parent(s): 7f7c62d

Update public/script.js

Browse files
Files changed (1) hide show
  1. public/script.js +2 -2
public/script.js CHANGED
@@ -59,9 +59,9 @@ function updateNavigationVisibility(searchQuery, totalPages) {
59
 
60
  // Call loadMusicList when the search input changes
61
  document.getElementById('search-bar').addEventListener('keyup', debounce(() => {
62
- currentPage = 1; // Reset to the first page on new search or clearing search
63
  loadMusicList();
64
- }, 1000)); // 500 milliseconds delay
65
 
66
  function loadMusicList() {
67
  const searchQuery = document.getElementById('search-bar').value.toLowerCase();
 
59
 
60
  // Call loadMusicList when the search input changes
61
  document.getElementById('search-bar').addEventListener('keyup', debounce(() => {
62
+ currentPage = 1;
63
  loadMusicList();
64
+ }, 500)); // Waits for 0.5s of inactivity after typing
65
 
66
  function loadMusicList() {
67
  const searchQuery = document.getElementById('search-bar').value.toLowerCase();