recent_view_ui: Cut import of user_card_popover.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2023-10-06 18:32:53 -07:00 committed by Tim Abbott
parent 27991bd5b0
commit 70748181da
2 changed files with 8 additions and 5 deletions

View File

@ -34,7 +34,6 @@ import * as timerender from "./timerender";
import * as ui_util from "./ui_util";
import * as unread from "./unread";
import * as unread_ops from "./unread_ops";
import * as user_card_popover from "./user_card_popover";
import * as user_status from "./user_status";
import * as user_topics from "./user_topics";
import * as views_util from "./views_util";
@ -1245,7 +1244,7 @@ export function change_focused_element($elt, input_key) {
return false;
}
export function initialize() {
export function initialize({on_click_participant}) {
// load filters from local storage.
if (!page_params.is_spectator) {
// A user may have a stored filter and can log out
@ -1257,8 +1256,7 @@ export function initialize() {
$("body").on("click", "#recent_view_table .recent_view_participant_avatar", function (e) {
const participant_user_id = Number.parseInt($(this).parent().attr("data-user-id"), 10);
e.stopPropagation();
const user = people.get_by_user_id(participant_user_id);
user_card_popover.toggle_user_card_popover(this, user);
on_click_participant(this, participant_user_id);
});
$("body").on(

View File

@ -592,7 +592,12 @@ export function initialize_everything() {
realm_logo.initialize();
message_lists.initialize();
message_list.initialize();
recent_view_ui.initialize();
recent_view_ui.initialize({
on_click_participant(avatar_element, participant_user_id) {
const user = people.get_by_user_id(participant_user_id);
user_card_popover.toggle_user_card_popover(avatar_element, user);
},
});
inbox_ui.initialize();
alert_words.initialize(alert_words_params);
emojisets.initialize();