blob: 10821be89fcbad8c0cc98f61be5e2a442c3ea349 [file] [log] [blame]
Javier López-Contreras6d1d72d2018-12-27 23:17:18 +01001// *********** HERE STARTS search-bar.js *************
2
Javier López-Contreras6d1d72d2018-12-27 23:17:18 +01003function altSearchBar() {
4 if (document.querySelector(".md-google-search__metacontainer").style.display == "none") {
5 document.querySelector(".md-google-search__metacontainer").style.display = "block";
6 document.querySelector("#search i").innerText = "fullscreen";
avm99963865b8ca2018-12-28 02:52:50 +01007 document.querySelector("#search-input").focus();
Javier López-Contreras6d1d72d2018-12-27 23:17:18 +01008 } else {
9 document.querySelector(".md-google-search__metacontainer").style.display = "none";
10 document.querySelector(".autocomplete-container").style.display = "none";
11 document.querySelector("#search i").innerText = "search";
12 }
13}
14
15function initSearchBar() {
16 document.querySelector("#search").addEventListener("click", altSearchBar);
17 if (window.innerWidth > 700) altSearchBar();
18}