diff --git a/app/public/static/collection_editor.js b/app/public/static/collection_editor.js index c5e66379..79bacdb5 100644 --- a/app/public/static/collection_editor.js +++ b/app/public/static/collection_editor.js @@ -99,11 +99,15 @@ function updateResults(packages) { document.getElementById("add_package_empty").style.display = packages.length === 0 ? "block" : "none"; const alreadyAdded = getAddedPackages(); - packages.filter(pkg => !alreadyAdded.includes(`${pkg.author}/${pkg.name}`)).slice(0, 5).forEach(pkg => { + packages.slice(0, 5).forEach(pkg => { const result = document.createElement("a"); result.classList.add("list-group-item"); result.classList.add("list-group-item-action"); result.innerText = `${pkg.title} by ${pkg.author}`; + if (alreadyAdded.includes(`${pkg.author}/${pkg.name}`)) { + result.classList.add("active"); + result.innerHTML = "" + result.innerHTML; + } result.addEventListener("click", () => addPackage(pkg)); results.appendChild(result); }); diff --git a/app/templates/collections/create_edit.html b/app/templates/collections/create_edit.html index 4b43e56a..03eab352 100644 --- a/app/templates/collections/create_edit.html +++ b/app/templates/collections/create_edit.html @@ -9,7 +9,7 @@ {% endblock %} {% block scriptextra %} - + {% endblock %} {% block content %}