header: Fix unresponsive dropdown pill on /help pages.

My PR #18974 introduced a bug where the logged-in dropdown pill on
the /help pages stopped working and has been unresponsive ever
since. This was caused by the incorrect assumption that each
`.dropdown` would be inside an unordered list `ul`. However, that
isn't the case for the dropdown pill on the /help pages. This commit
simply removes said assumption, by widening the scope of the relevant
CSS selectors.
This commit is contained in:
Eeshan Garg
2021-12-17 16:08:20 -05:00
committed by Tim Abbott
parent 2004f94082
commit 7196b5ac84

View File

@@ -8,12 +8,12 @@ $(() => {
$(".dropdown").on("click", (e) => {
const $this = $(e.target);
const dropdown_is_shown = $this.closest("ul .dropdown").hasClass("show");
const dropdown_is_shown = $this.closest(".dropdown").hasClass("show");
if (!dropdown_is_shown) {
$this.closest("ul .dropdown").addClass("show");
$this.closest(".dropdown").addClass("show");
} else if (dropdown_is_shown) {
$this.closest("ul .dropdown").removeClass("show");
$this.closest(".dropdown").removeClass("show");
}
});