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.

user-profile: Use more specific ID for user profile modal header.

Sahil Batrab9c85af30ab6
diff --git a/web/src/user_profile.ts b/web/src/user_profile.ts
index 875e8668e5f..d457ca1297b 100644
--- a/web/src/user_profile.ts
+++ b/web/src/user_profile.ts
@@ -192,7 +192,7 @@ export function update_profile_modal_ui(
name: user.full_name,
should_add_guest_user_indicator: people.should_add_guest_user_indicator(user.user_id),
};
- $("#name .user-profile-name").html(render_user_full_name(user_type));
+ $("#user-profile-name-heading .user-profile-name").html(render_user_full_name(user_type));
}
}
@@ -1643,20 +1643,28 @@ export function initialize(): void {
add_user_to_groups(group_ids, user_id, $alert_box);
});
- $("body").on("click", "#user-profile-modal #name .user-profile-update-user-tab-button", (e) => {
- show_manage_user_tab("manage-profile-tab");
- e.stopPropagation();
- e.preventDefault();
- });
+ $("body").on(
+ "click",
+ "#user-profile-name-heading .user-profile-update-user-tab-button",
+ (e) => {
+ show_manage_user_tab("manage-profile-tab");
+ e.stopPropagation();
+ e.preventDefault();
+ },
+ );
/* These click handlers are implemented as just deep links to the
* relevant part of the Zulip UI, so we don't want preventDefault,
* but we do want to close the modal when you click them. */
- $("body").on("click", "#user-profile-modal #name .user-profile-profile-settings-button", () => {
- hide_user_profile();
- browser_history.go_to_location("#settings/profile");
- });
+ $("body").on(
+ "click",
+ "#user-profile-name-heading .user-profile-profile-settings-button",
+ () => {
+ hide_user_profile();
+ browser_history.go_to_location("#settings/profile");
+ },
+ );
$("body").on(
"keydown",
diff --git a/web/templates/user_profile_modal.hbs b/web/templates/user_profile_modal.hbs
index 70ba60b06c9..58c90c9a927 100644
--- a/web/templates/user_profile_modal.hbs
+++ b/web/templates/user_profile_modal.hbs
@@ -1,9 +1,9 @@
<div class="micromodal" id="user-profile-modal" data-user-id="{{user_id}}" aria-hidden="true">
<div class="modal__overlay" tabindex="-1">
- <div class="modal__container" role="dialog" aria-modal="true" aria-labelledby="name">
+ <div class="modal__container" role="dialog" aria-modal="true" aria-labelledby="user-profile-name-heading">
<div class="modal__header">
<div class="modal__header-content">
- <h1 class="modal__title user-profile-name-heading" id="name">
+ <h1 class="modal__title user-profile-name-heading" id="user-profile-name-heading">
{{#unless is_bot}}
{{#if is_active}}
<span class="tippy-zulip-tooltip user-status-icon-wrapper" data-tippy-content="{{last_seen}}">