From 555ac8ee203f8c1772568a9e086ddfdb8e72978c Mon Sep 17 00:00:00 2001 From: Guus van Meerveld <57101832+Guusvanmeerveld@users.noreply.github.com> Date: Wed, 27 Nov 2019 13:50:47 +0100 Subject: [PATCH] Changed the searchbar --- resources/js/insertNavbar.js | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/resources/js/insertNavbar.js b/resources/js/insertNavbar.js index d13bd5a..efb3685 100644 --- a/resources/js/insertNavbar.js +++ b/resources/js/insertNavbar.js @@ -22,10 +22,10 @@ navigation.prepend(hamburger) // Search var search = c("input") -search.className = "searchMove searchBar" +search.className = "searchBar" search.placeholder = "Vul een zoek opdracht of url in" search.type = "text" -document.body.prepend(search) +navigation.appendChild(search) g(".searchBar").addEventListener("keyup",searchEnter) function searchEnter(key) { @@ -46,28 +46,6 @@ function searchEnter(key) { } } -function showSearch() { - var open = !g(".searchBar").classList.contains("searchMove") - if (open) { - closeSearch(); - } - else { - openSearch(); - } -} - -function closeSearch() { - $(".opacityMenu").addClass("lowerIndex") - g(".searchBar").blur() - g(".searchBar").classList.add("searchMove") -} - -function openSearch(e) { - $(".opacityMenu").removeClass("lowerIndex") - g(".searchBar").classList.remove("searchMove") - g(".searchBar").focus() -} - // Create Navbar Navbar.forEach(i=>{ var navList = c("li") @@ -84,9 +62,6 @@ Navbar.forEach(i=>{ if (i.desc) { navButton.title = i.desc } - if (i.func) { - navButton.setAttribute('onclick',i.func) - } navList.appendChild(navButton) var dropdownList = c("ul") dropdownList.className = "dropdownList"