Javier López-Contreras | 6d1d72d | 2018-12-27 23:17:18 +0100 | [diff] [blame] | 1 | // *********** HERE STARTS search-bar.js *************
|
| 2 |
|
Javier López-Contreras | 6d1d72d | 2018-12-27 23:17:18 +0100 | [diff] [blame] | 3 | function 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";
|
avm99963 | 865b8ca | 2018-12-28 02:52:50 +0100 | [diff] [blame] | 7 | document.querySelector("#search-input").focus();
|
Javier López-Contreras | 6d1d72d | 2018-12-27 23:17:18 +0100 | [diff] [blame] | 8 | } 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 |
|
| 15 | function initSearchBar() {
|
| 16 | document.querySelector("#search").addEventListener("click", altSearchBar);
|
| 17 | if (window.innerWidth > 700) altSearchBar();
|
| 18 | }
|