-
-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
af313cd
commit dffe2a9
Showing
2 changed files
with
50 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,14 @@ | ||
/** | ||
* | ||
* @param {string} input | ||
*/ | ||
function search() { | ||
const input = document.querySelector("#searchInput").value; | ||
if (input === "" || input.trim() === "") { | ||
// do litteraly nothing | ||
} else { | ||
window.location.href = `/search/${encodeURIComponent( | ||
escape(input.trim()) | ||
)}`; | ||
} | ||
} | ||
|
||
function hamburger() { | ||
document.getElementById("hamburgerDropdown").classList.toggle("show"); | ||
} | ||
|
||
window.onclick = function(event) { | ||
if (!event.target.matches(".hamburgerBtn")) { | ||
var dropdowns = document.getElementsByClassName("hamburgerContent"); | ||
var i; | ||
for (i = 0; i < dropdowns.length; i++) { | ||
var openDropdown = dropdowns[i]; | ||
if (openDropdown.classList.contains("show")) { | ||
openDropdown.classList.remove("show"); | ||
} | ||
} | ||
} | ||
}; |