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.

recent topics: Display user info popover when clicking participants.

yogesh sirsat8a1df07e648c
diff --git a/static/js/click_handlers.js b/static/js/click_handlers.js
index 801dc9490ef..257b2613899 100644
--- a/static/js/click_handlers.js
+++ b/static/js/click_handlers.js
@@ -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) => {
diff --git a/static/styles/recent_topics.css b/static/styles/recent_topics.css
index e1d03183eb1..52ef92662e2 100644
--- a/static/styles/recent_topics.css
+++ b/static/styles/recent_topics.css
@@ -183,6 +183,7 @@
padding: 0 1.5px;
position: relative;
min-width: 24px;
+ cursor: pointer;
.fa-user {
opacity: 0.7;
diff --git a/static/templates/recent_topic_row.hbs b/static/templates/recent_topic_row.hbs
index 91a2ce1fdc5..b2d2b1acf4d 100644
--- a/static/templates/recent_topic_row.hbs
+++ b/static/templates/recent_topic_row.hbs
@@ -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}}