messages_overlay: Fix multiple IDs selected accidentally.

Since `success_message_scheduled_banner` and scheduled message overlay
both use `data-scheduled-message-id`, `get_element_by_id` needs
to be more specific which selector it wants.
This commit is contained in:
Aman Agrawal 2024-09-10 13:09:25 +00:00 committed by Tim Abbott
parent e8349aa5d7
commit 93f0581197
1 changed files with 3 additions and 1 deletions

View File

@ -181,5 +181,7 @@ function scroll_to_element($element: JQuery, context: Context): void {
} }
function get_element_by_id(id: number | string, context: Context): JQuery { function get_element_by_id(id: number | string, context: Context): JQuery {
return $(`[${CSS.escape(context.id_attribute_name)}='${CSS.escape(id.toString())}']`); return $(
`.overlay-message-row[${CSS.escape(context.id_attribute_name)}='${CSS.escape(id.toString())}']`,
);
} }