Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

header: Improve dropdown click handler.

Aman Agrawald3dc26cbad8c
diff --git a/web/src/portico/header.ts b/web/src/portico/header.ts
index 887d0ae78ec..1314f05ff5b 100644
--- a/web/src/portico/header.ts
+++ b/web/src/portico/header.ts
@@ -87,14 +87,14 @@ $(() => {
return false;
});
- $(".dropdown").on("click", (e) => {
- const $this = $(e.target);
- const dropdown_is_shown = $this.closest(".dropdown").hasClass("show");
+ $(".portico-header .dropdown").on("click", (e) => {
+ const $user_dropdown = $(e.target).closest(".dropdown");
+ const dropdown_is_shown = $user_dropdown.hasClass("show");
if (!dropdown_is_shown) {
- $this.closest(".dropdown").addClass("show");
+ $user_dropdown.addClass("show");
} else if (dropdown_is_shown) {
- $this.closest(".dropdown").removeClass("show");
+ $user_dropdown.removeClass("show");
}
});
});