fix: Make dropdowns toggle correctly on click/hover combo (#4265)

Fixes #4095
This commit is contained in:
Lars Eggert 2022-07-24 08:13:12 -04:00 committed by GitHub
parent de4f1feed2
commit 98af0e8a58
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -94,14 +94,14 @@ $(document)
$(document)
.ready(function () {
function dropdown_hover() {
function dropdown_hover(e) {
var navbar = $(this)
.closest(".navbar");
if (navbar.length === 0 || navbar.find(".navbar-toggler")
.is(":hidden")) {
$(this)
.children(".dropdown-toggle")
.dropdown("toggle");
.dropdown(e.type == "mouseenter" ? "show" : "hide");
}
}