mirror of
https://github.com/zulip/zulip.git
synced 2025-11-14 02:48:00 +00:00
message_list_tooltips: Avoid showing undefined.
If the template_id of the message_control_button is undefined, we do not render the tooltip at all. This might happen, for example, when a message is past its editable period and the edit button is not displayed.
This commit is contained in:
@@ -232,9 +232,14 @@ export function initialize(): void {
|
|||||||
if (tippy_content !== undefined) {
|
if (tippy_content !== undefined) {
|
||||||
instance.setContent(tippy_content);
|
instance.setContent(tippy_content);
|
||||||
} else {
|
} else {
|
||||||
const $template = $(`#${CSS.escape($elem.attr("data-tooltip-template-id")!)}`);
|
const template_id = $elem.attr("data-tooltip-template-id");
|
||||||
|
if (template_id === undefined) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
const $template = $(`#${CSS.escape(template_id)}`);
|
||||||
instance.setContent(parse_html($template.html()));
|
instance.setContent(parse_html($template.html()));
|
||||||
}
|
}
|
||||||
|
return undefined;
|
||||||
},
|
},
|
||||||
onHidden(instance) {
|
onHidden(instance) {
|
||||||
instance.destroy();
|
instance.destroy();
|
||||||
|
|||||||
Reference in New Issue
Block a user