mirror of https://github.com/zulip/zulip.git
message_list_tooltips: Create '$template' conditionally.
We only expect 'data-tooltip-template-id' to be present if 'tippy_content' is not valid.Hence, only when 'tippy_content' is undefined, should we create '$template'.
This commit is contained in:
parent
92ba149f5f
commit
b0377d5d6d
|
@ -193,8 +193,12 @@ export function initialize() {
|
|||
// Handle dynamic "starred messages" and "edit" widgets.
|
||||
const $elem = $(instance.reference);
|
||||
const tippy_content = $elem.attr("data-tippy-content");
|
||||
const $template = $(`#${CSS.escape($elem.attr("data-tooltip-template-id"))}`);
|
||||
instance.setContent(tippy_content ?? parse_html($template.html()));
|
||||
if (tippy_content !== undefined) {
|
||||
instance.setContent(tippy_content);
|
||||
} else {
|
||||
const $template = $(`#${CSS.escape($elem.attr("data-tooltip-template-id"))}`);
|
||||
instance.setContent(parse_html($template.html()));
|
||||
}
|
||||
},
|
||||
onHidden(instance) {
|
||||
instance.destroy();
|
||||
|
|
Loading…
Reference in New Issue