private readonly queryInput: HTMLInputElement;
private readonly typeInput: HTMLSelectElement;
private readonly delimiter: HTMLDivElement;
+ private readonly filtersContainer: HTMLElement;
private searchID: number | undefined = undefined;
private pages = 0;
private activePage = 1;
this.form = document.getElementById("extendedSearchForm") as HTMLFormElement;
this.queryInput = document.getElementById("searchQuery") as HTMLInputElement;
this.typeInput = document.getElementById("searchType") as HTMLSelectElement;
+ this.filtersContainer = document.querySelector(".searchFiltersContainer") as HTMLElement;
this.delimiter = document.createElement("div");
this.form.insertAdjacentElement("afterend", this.delimiter);
this.pages = pages!;
this.activePage = pageNo!;
this.showSearchResults(template!);
+ } else if (Object.keys(this.getFormData()).length > 4) {
+ // If no results are found and advanced filters are active,
+ // make sure that the corresponding area is shown,
+ this.filtersContainer.setAttribute("open", "");
}
}
queryInput;
typeInput;
delimiter;
+ filtersContainer;
searchID = undefined;
pages = 0;
activePage = 1;
this.form = document.getElementById("extendedSearchForm");
this.queryInput = document.getElementById("searchQuery");
this.typeInput = document.getElementById("searchType");
+ this.filtersContainer = document.querySelector(".searchFiltersContainer");
this.delimiter = document.createElement("div");
this.form.insertAdjacentElement("afterend", this.delimiter);
this.initEventListener();
this.activePage = pageNo;
this.showSearchResults(template);
}
+ else if (Object.keys(this.getFormData()).length > 4) {
+ // If no results are found and advanced filters are active,
+ // make sure that the corresponding area is shown,
+ this.filtersContainer.setAttribute("open", "");
+ }
}
updateQueryString(searchAction) {
const url = new URL(this.form.action);