user_profile: Replace the id with class for pencil button.

This commit replaces the id attribute with class attribute for the
edit pencil button in user profile modal.
This commit is contained in:
palashb01
2023-08-17 17:10:56 +05:30
committed by Tim Abbott
parent 135518435a
commit 1c049ab5f4
4 changed files with 8 additions and 7 deletions

View File

@@ -529,17 +529,18 @@ export function register_click_handlers() {
$("body").on(
"click",
"#user-profile-modal #name #user_profile_manage_others_edit_button",
"#user-profile-modal #name .user_profile_manage_others_edit_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_manage_own_edit_button", () => {
$("body").on("click", "#user-profile-modal #name .user_profile_manage_own_edit_button", () => {
hide_user_profile();
});

View File

@@ -68,7 +68,7 @@
text-overflow: ellipsis;
}
#user_profile_manage_others_edit_button {
.user_profile_manage_others_edit_button {
color: hsl(200deg 100% 50%);
cursor: pointer;

View File

@@ -459,8 +459,8 @@ ul {
}
}
#user_profile_manage_own_edit_button,
#user_profile_manage_others_edit_button {
.user_profile_manage_own_edit_button,
.user_profile_manage_others_edit_button {
width: 25px;
text-align: center;
font-size: 18px;

View File

@@ -14,11 +14,11 @@
<span class="user_profile_name">{{full_name}}</span>
{{#if is_me}}
<a href="/#settings/profile">
<i class="fa fa-edit" id="user_profile_manage_own_edit_button" aria-hidden="true"></i>
<i class="fa fa-edit user_profile_manage_own_edit_button" aria-hidden="true"></i>
</a>
{{/if}}
{{#if can_manage_profile}}
<i class="fa fa-edit" id="user_profile_manage_others_edit_button" aria-hidden="true"></i>
<i class="fa fa-edit user_profile_manage_others_edit_button" aria-hidden="true"></i>
{{/if}}
</h1>
<button class="modal__close" aria-label="{{t 'Close modal' }}" data-micromodal-close></button>