mirror of
https://github.com/zulip/zulip.git
synced 2025-11-16 20:02:15 +00:00
refactor: Move replace_emoji_with_text from ui to ui_util.
This commit is contained in:
@@ -21,6 +21,15 @@ export function place_caret_at_end(el: HTMLElement): void {
|
||||
}
|
||||
}
|
||||
|
||||
export function replace_emoji_with_text($element: JQuery): void {
|
||||
$element.find(".emoji").replaceWith(function () {
|
||||
if ($(this).is("img")) {
|
||||
return $(this).attr("alt") ?? "";
|
||||
}
|
||||
return $(this).text();
|
||||
});
|
||||
}
|
||||
|
||||
export function blur_active_element(): void {
|
||||
// this blurs anything that may perhaps be actively focused on.
|
||||
if (document.activeElement instanceof HTMLElement) {
|
||||
|
||||
Reference in New Issue
Block a user