recent topics: Display user info popover when clicking participants.

Tweaked by tabbott to do something reasonable for muted users and
display a cursor indicating clicking will do something.

Fixes #21154.
This commit is contained in:
yogesh sirsat
2022-02-17 20:12:40 +05:30
committed by Tim Abbott
parent 70c9c2e137
commit 8a1df07e64
3 changed files with 11 additions and 2 deletions

View File

@@ -29,6 +29,7 @@ import * as narrow from "./narrow";
import * as notifications from "./notifications";
import * as overlays from "./overlays";
import {page_params} from "./page_params";
import * as people from "./people";
import * as popovers from "./popovers";
import * as reactions from "./reactions";
import * as recent_topics_ui from "./recent_topics_ui";
@@ -376,6 +377,13 @@ export function initialize() {
// RECENT TOPICS
$("#recent_topics_table").on("click", ".participant_profile", function (e) {
const participant_user_id = Number.parseInt($(this).attr("data-user-id"), 10);
e.stopPropagation();
const user = people.get_by_user_id(participant_user_id);
popovers.show_user_info_popover(this, user);
});
$("body").on("keydown", ".on_hover_topic_mute", ui_util.convert_enter_to_click);
$("body").on("click", "#recent_topics_table .on_hover_topic_unmute", (e) => {

View File

@@ -183,6 +183,7 @@
padding: 0 1.5px;
position: relative;
min-width: 24px;
cursor: pointer;
.fa-user {
opacity: 0.7;

View File

@@ -38,11 +38,11 @@
{{/if}}
{{#each senders}}
{{#if this.is_muted}}
<li class="recent_topics_participant_item tippy-zulip-tooltip" data-tippy-content="{{t 'Muted user'}}">
<li class="recent_topics_participant_item participant_profile tippy-zulip-tooltip" data-tippy-content="{{t 'Muted user'}}" data-user-id="{{this.user_id}}">
<span><i class="fa fa-user recent_topics_participant_overflow"></i></span>
</li>
{{else}}
<li class="recent_topics_participant_item tippy-zulip-tooltip" data-tippy-content="{{this.full_name}}">
<li class="recent_topics_participant_item participant_profile tippy-zulip-tooltip" data-tippy-content="{{this.full_name}}" data-user-id="{{this.user_id}}">
<img src="{{this.avatar_url_small}}" class="recent_topics_participant_avatar" />
</li>
{{/if}}