Bug 40726: Prevent closing the user menu when clicking off of the dropdown

To test:

1. In the staff interface click on the user menu (top right corner where it has the user and library branch).
2. Click the gear icon.
3. Try to click a dropdown but miss it and click outside of it (still in the grey box area).
4. View the menu collapsing.
5. Apply the patch & restart all. Refresh your page.
6. Retry steps 1-3. Notice now that when you click within the grey box area around the drop down the user menu no longer closes. However, if you click outside of the dropdown menu (anywhere else on the interface screen) the user menu closes.
7. Sign off — have an amazing day! :D

Signed-off-by: noah <noah@inlibro.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Laura_Escamilla 2025-08-29 14:16:04 +00:00 committed by Lucas Gass
parent 7f2aedfd3e
commit 56d69d9f4d
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
1 changed files with 13 additions and 0 deletions

View File

@ -442,6 +442,19 @@ $(document).ready(function () {
}
});
(function () {
const trigger = document.getElementById("logged-in-menu");
if (trigger) {
bootstrap.Dropdown.getOrCreateInstance(trigger, {
autoClose: "outside",
});
}
})();
$("#setlibrary_panel").on("click", function (e) {
e.stopPropagation();
});
$("#logged-in-dropdown").on("hidden.bs.dropdown", function () {
$("#setlibrary_panel")
.removeClass("setlibrary_panel_open")