Skip to content

Commit 3ce0e0e

Browse files
committedFeb 17, 2025
Add comment
1 parent bb72f22 commit 3ce0e0e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed
 

‎js/site.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ document.body.addEventListener("click", function (event) {
1616
dropdown.querySelector(".judge0-dropdown-menu").classList.toggle("hidden");
1717
}
1818

19+
// For each dropdown menu check if it needs to be hidden.
20+
// If the click is outside of the dropdown menu and if that dropdown menu is not
21+
// the dropdown menu of the just clicked dropdown button, hide it.
1922
document.querySelectorAll(".judge0-dropdown-menu").forEach(function (dropdownMenu) {
2023
if (!dropdownMenu.contains(event.target) && dropdown !== dropdownMenu.closest(".judge0-dropdown")) {
2124
dropdownMenu.classList.add("hidden");

0 commit comments

Comments
 (0)