/
githubmirror
/
zulip
Обзор
Документация
Войти
/
githubmirror
/
zulip
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
web/src/compose_textarea.ts
25 строк
833 B
Anders Kaseorg
web: Use named import for jQuery.
29 июл 2026, 02:35
29 июл 2026, 02:35
52a10e8
Код
Авторство
О чём код?
import {$} from "jquery"; // Save the compose content cursor position and restore when we // shift-tab back in (see hotkey.ts). let saved_compose_cursor = 0; function set_compose_textarea_handlers(): void { $("textarea#compose-textarea").on("blur", function () { saved_compose_cursor = $(this).caret(); }); // on the end of the modified-message fade in, remove the fade-in-message class. const animationEnd = "webkitAnimationEnd oanimationend msAnimationEnd animationend"; $("body").on(animationEnd, ".fade-in-message", function () { $(this).removeClass("fade-in-message"); }); } export function restore_compose_cursor(): void { $("textarea#compose-textarea").trigger("focus").caret(saved_compose_cursor); } export function initialize(): void { set_compose_textarea_handlers(); }