Skip to content

Commit

Permalink
[UI] Fix Navbar not closing on click getting started in mobile view
Browse files Browse the repository at this point in the history
Signed-off-by: hymmns <[email protected]>
  • Loading branch information
hymmns committed Aug 29, 2024
1 parent 698bc0c commit 6d03a07
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
6 changes: 4 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ GEM
eventmachine (>= 0.12.9)
http_parser.rb (~> 0)
eventmachine (1.2.7)
ffi (1.16.3)
ffi (1.16.3-x64-mingw-ucrt)
ffi (1.17.0-arm64-darwin)
ffi (1.17.0-x64-mingw-ucrt)
ffi (1.17.0-x86_64-darwin)
ffi (1.17.0-x86_64-linux-gnu)
forwardable-extended (2.6.0)
google-protobuf (3.25.3-arm64-darwin)
google-protobuf (3.25.3-x64-mingw-ucrt)
Expand Down
15 changes: 13 additions & 2 deletions _includes/navigation.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
<div class="stellarnav">
<ul class="nav-list">
{% for link in site.data.navigation %}
<li class="nav-item">
<li class="nav-item"
{% if link.highlight %} onclick="onClickGettingStarted()" {% endif%}>
{% assign class = "nav-text" %}
{% if link.highlight %}
{% assign class = class | append: " highlight" %}
Expand Down Expand Up @@ -46,4 +47,14 @@
</ul>

</div>
</nav>
</nav>
<script>
function onClickGettingStarted(){
const stellarNav = document.querySelector(".stellarnav");
const navList = document.querySelector(".nav-list");

if (stellarNav.classList.contains("mobile")) {
navList.style.display = "none";
}
}
</script>

0 comments on commit 6d03a07

Please sign in to comment.