fixed bugs:
- suppressed display of search results if nothing was found but there were previous searches - improved display timing of search results/initial pages, which led to false displays
This commit is contained in:
parent
49eda4ce0a
commit
15f743d8ab
@ -17,8 +17,10 @@ export function fetchQuery(fetchString, clearResults) {
|
||||
function parseContent(content, clearResults) {
|
||||
if (content.length === 0) {
|
||||
searchSection.querySelector("#nothing-found ").classList.remove("hidden");
|
||||
searchSection.querySelector(".datasets").classList.add("hidden");
|
||||
} else {
|
||||
searchSection.querySelector("#nothing-found").classList.add("hidden");
|
||||
searchSection.querySelector(".datasets").classList.remove("hidden");
|
||||
const datasets = content.map(dataset => new Dataset(dataset));
|
||||
if (clearResults) {
|
||||
Array.from(searchSection.querySelectorAll(".datasets .dataset")).forEach(e => e.remove());
|
||||
|
@ -78,10 +78,6 @@ header {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.hidden {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#search-entry:focus-visible {
|
||||
outline: none;
|
||||
}
|
||||
@ -93,6 +89,11 @@ header {
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
.hidden {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
||||
@container (width < 60ch) {
|
||||
.datasets {
|
||||
grid-template-columns: 1fr;
|
||||
|
@ -47,10 +47,10 @@ searchButton.addEventListener("click", () => {
|
||||
});
|
||||
|
||||
searchBar.addEventListener("input", () => {
|
||||
updateSections();
|
||||
clearTimeout(searchBarTimeout);
|
||||
searchBarTimeout = setTimeout(() => {
|
||||
fetchQuery(createQuery(), true);
|
||||
updateSections();
|
||||
}, searchDelay);
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user