blob: af271a217acbcd7e8a82c35fb0c62f8f96cde5ae [file] [log] [blame]
Javier López-Contreras6d1d72d2018-12-27 23:17:18 +01001function altSearchBar() {
2 if (document.querySelector(".md-google-search__metacontainer").style.display == "none") {
3 document.querySelector(".md-google-search__metacontainer").style.display = "block";
4 document.querySelector("#search i").innerText = "fullscreen";
avm99963865b8ca2018-12-28 02:52:50 +01005 document.querySelector("#search-input").focus();
Javier López-Contreras6d1d72d2018-12-27 23:17:18 +01006 } else {
7 document.querySelector(".md-google-search__metacontainer").style.display = "none";
8 document.querySelector(".autocomplete-container").style.display = "none";
9 document.querySelector("#search i").innerText = "search";
10 }
11}
12
13function initSearchBar() {
14 document.querySelector("#search").addEventListener("click", altSearchBar);
15 if (window.innerWidth > 700) altSearchBar();
16}