Skip to content

Commit

Permalink
fix: horizontal menu hover submenu not working
Browse files Browse the repository at this point in the history
  • Loading branch information
zuramai committed Apr 2, 2023
1 parent d6b92af commit 6a79041
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
19 changes: 11 additions & 8 deletions src/assets/scss/components/_navbar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -191,14 +191,17 @@
&.active .submenu-link {
color: var(--bs-primary)
}
&.has-sub .submenu-link {
position: relative;
&:after {
position: absolute;
right: 10px;
top: 50%;
transform: translateY(-40%);
content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23888' class='bi bi-chevron-right' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
&.has-sub {
overflow: visible;
.submenu-link {
position: relative;
&:after {
position: absolute;
right: 10px;
top: 50%;
transform: translateY(-40%);
content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23888' class='bi bi-chevron-right' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
}
}
}
a {
Expand Down
3 changes: 2 additions & 1 deletion src/assets/static/js/components/sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,11 +217,13 @@ class Sidebar {



let sidebarEl = document.getElementById("sidebar")

/**
* On First Load
*/
const onFirstLoad = (sidebarEL) => {
if(!sidebarEl) return
if (isDesktop(window)) {
sidebarEL.classList.add("active")
sidebarEL.classList.add('sidebar-desktop')
Expand All @@ -242,7 +244,6 @@ const onFirstLoad = (sidebarEL) => {
}
}

let sidebarEl = document.getElementById("sidebar")
if(document.readyState !== 'loading') {
onFirstLoad(sidebarEl)
}
Expand Down

0 comments on commit 6a79041

Please sign in to comment.