From cc96be2bf90d667e70a640e624c8bb2383f74ac3 Mon Sep 17 00:00:00 2001 From: Aman Agrawal Date: Mon, 13 Feb 2023 04:10:50 +0000 Subject: [PATCH] recent_conversation: Delegate profile click handling to `body`. `#recent_topics_table` may not be present in the DOM when this click handler is initialized which can cause this it to not work, delegating it to body ensures it will always work. --- static/js/recent_topics_ui.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/js/recent_topics_ui.js b/static/js/recent_topics_ui.js index f9c26db506..dac3a22d19 100644 --- a/static/js/recent_topics_ui.js +++ b/static/js/recent_topics_ui.js @@ -1216,7 +1216,7 @@ export function initialize() { filters = new Set(ls.get(ls_key)); } - $("#recent_topics_table").on("click", ".participant_profile", function (e) { + $("body").on("click", "#recent_topics_table .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);