Skip to content

Commit

Permalink
fix: hide list when closing search bar
Browse files Browse the repository at this point in the history
  • Loading branch information
Tanguy-Boisset committed Oct 10, 2023
1 parent bbd3c21 commit 52d1e85
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ad_miner/sources/html/templates/main_header.html
Expand Up @@ -41,7 +41,7 @@ <h1 class="ml-0 text-light" id="title_current_page">
<i class="bi bi-search"></i>
</button>
</h1>
<div class="form-inline my-2 my-lg-0 search-bar-div-hide" id="search-bar-div">
<div class="form-inline my-2 my-lg-0" id="search-bar-div">
<div id="search-bar-div-2">
<input class="form-control mr-sm-2" id="search-bar" type="search" placeholder="Search" aria-label="Search">
<div id="search-dropdown"></div>
Expand Down
2 changes: 2 additions & 0 deletions ad_miner/sources/js/search_bar.js
Expand Up @@ -5,7 +5,9 @@ Controls the search bar on the main page.
// Hide and display the search bar
function toggleSearch() {
const searchBarDiv = document.getElementById("search-bar-div");
const searchItemDropdown = document.getElementById("search-dropdown");
(searchBarDiv.classList.contains("search-bar-div-show")) ? searchBarDiv.classList.remove("search-bar-div-show") : searchBarDiv.classList.add("search-bar-div-show");
(searchItemDropdown.classList.contains("active")) ? searchItemDropdown.classList.remove("active") : searchItemDropdown.classList.add("active");
searchBar.focus();
}

Expand Down

0 comments on commit 52d1e85

Please sign in to comment.