blob: 10821be89fcbad8c0cc98f61be5e2a442c3ea349 [file] [log] [blame]
// *********** HERE STARTS search-bar.js *************
function altSearchBar() {
if (document.querySelector(".md-google-search__metacontainer").style.display == "none") {
document.querySelector(".md-google-search__metacontainer").style.display = "block";
document.querySelector("#search i").innerText = "fullscreen";
document.querySelector("#search-input").focus();
} else {
document.querySelector(".md-google-search__metacontainer").style.display = "none";
document.querySelector(".autocomplete-container").style.display = "none";
document.querySelector("#search i").innerText = "search";
}
}
function initSearchBar() {
document.querySelector("#search").addEventListener("click", altSearchBar);
if (window.innerWidth > 700) altSearchBar();
}