class SearchController {

	autocomplete(e, element) {
		let url = element.href;
		
		if (element.value) {
			delay(() => loadAjax(window.location.pathname + location.search, ".search-results", null, {'module':'tools/search', search:element.value}), 1000);
		} else {
			document.querySelector(".search-results")?.replaceChildren();
		}
		//e.preventDefault();
		//return false;
	}
	
}

let Search = new SearchController();
export {Search};
