Skip to content

Commit

Permalink
fix: Fix menu hover issue (#6019)
Browse files Browse the repository at this point in the history
* fix: Fix menu hover issue

Fixes #5702

* Fix leftmenu hover issue
  • Loading branch information
larseggert authored Jul 22, 2023
1 parent 8a88210 commit c717673
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 16 deletions.
28 changes: 28 additions & 0 deletions ietf/static/css/ietf.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
15 changes: 0 additions & 15 deletions ietf/static/js/ietf.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -140,9 +128,6 @@ $(document)
}
attachTo.append(menu.join(""));
}

$("ul.nav li.dropdown, ul.nav li.dropend")
.on("mouseenter mouseleave", dropdown_hover);
}
});
});
Expand Down
1 change: 0 additions & 1 deletion ietf/templates/base/menu.html
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c717673

Please sign in to comment.