message_controls: Fix "undefined" tooltip content.

This commit is contained in:
Daniil Fadeev 2023-03-23 17:28:08 +04:00 committed by Tim Abbott
parent 00988c7ea8
commit e8f5e8da4f
1 changed files with 3 additions and 1 deletions

View File

@ -171,8 +171,10 @@ export function initialize() {
onShow(instance) { onShow(instance) {
// Handle dynamic "starred messages" and "edit" widgets. // Handle dynamic "starred messages" and "edit" widgets.
const $elem = $(instance.reference); const $elem = $(instance.reference);
const tippy_content = $elem.attr("data-tippy-content");
const $template = $("#" + $elem.attr("data-tooltip-template-id")); const $template = $("#" + $elem.attr("data-tooltip-template-id"));
instance.setContent(parse_html($template.html()));
instance.setContent(tippy_content ?? parse_html($template.html()));
}, },
}); });