diff --git a/js/index.js b/js/index.js index 3f4317d8..01707a25 100644 --- a/js/index.js +++ b/js/index.js @@ -203,6 +203,7 @@ function updateList() { // then fill it with the sorted and filtered list for (const item of elems) { document.getElementById("gamesList").appendChild(item); + updateGameList(); } } $("#search").on("input", updateList); @@ -211,12 +212,6 @@ $("#sort").on("change", updateList); dragElement(document.getElementById("gameButton")); dragElement(document.getElementById("refresh")); -function toggleStar(event, star) { - event.preventDefault(); - event.stopPropagation(); - star.classList.toggle('filled'); -} - /** * Adds drag functionality to an HTML element. * @@ -283,6 +278,11 @@ function returnHome() { } /** +function toggleStar(event, star) { + event.preventDefault(); + event.stopPropagation(); + star.classList.toggle('filled'); +} * Refreshes the current page by reloading it. * * @return {void}