fix: Fix menu hover issue (#6019)

* fix: Fix menu hover issue

Fixes #5702

* Fix leftmenu hover issue
This commit is contained in:
Lars Eggert 2023-07-23 01:38:20 +03:00 committed by GitHub
parent 8a8821072f
commit c717673060
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 28 additions and 16 deletions

View file

@ -84,6 +84,34 @@ html {
scroll-padding-top: 60px;
}
// Make submenus open on hover.
@include media-breakpoint-up(lg) {
.dropdown-menu>li>ul {
display: none;
}
.dropdown-menu>li:hover>ul {
display: block;
}
}
@include media-breakpoint-up(md) {
.leftmenu .nav>li>ul {
display: none;
}
.leftmenu .nav>li:hover>ul {
display: block;
}
}
:is(.dropdown-menu, .leftmenu .nav) .dropdown-menu {
top: 0;
left: 100%;
right: auto;
}
// Make textareas in forms use a monospace font
textarea.form-control {
font-family: $font-family-code;

View file

@ -93,18 +93,6 @@ $(document)
$(document)
.ready(function () {
function dropdown_hover(e) {
var navbar = $(this)
.closest(".navbar");
if (navbar.length === 0 || navbar.find(".navbar-toggler")
.is(":hidden")) {
$(this)
.children(".dropdown-toggle")
.dropdown(e.type == "mouseenter" ? "show" : "hide");
}
}
// load data for the menu
$.ajax({
url: $(document.body)
@ -140,9 +128,6 @@ $(document)
}
attachTo.append(menu.join(""));
}
$("ul.nav li.dropdown, ul.nav li.dropend")
.on("mouseenter mouseleave", dropdown_hover);
}
});
});

View file

@ -10,7 +10,6 @@
<a href="#"
class="nav-link dropdown-toggle"
role="button"
data-bs-auto-close="false"
data-bs-toggle="dropdown"
aria-expanded="false">
Groups