emoji_picker: Move module event registration to initialization.

This commit is contained in:
Daniil Fadeev 2023-09-11 13:59:27 +04:00 committed by Tim Abbott
parent b0007bf5ca
commit a2b4db07f6
3 changed files with 5 additions and 3 deletions

View File

@ -658,7 +658,6 @@ export function initialize() {
popovers.register_click_handlers();
user_profile.register_click_handlers();
emoji_picker.register_click_handlers();
stream_popover.register_click_handlers();
$("body").on("click", ".logout_button", () => {

View File

@ -695,7 +695,7 @@ export function toggle_emoji_popover(target, id, additional_popover_options) {
{show_as_overlay},
);
}
export function register_click_handlers() {
function register_click_handlers() {
$(document).on("click", ".emoji-popover-emoji.reaction", function (e) {
// When an emoji is clicked in the popover,
// if the user has reacted to this message with this emoji
@ -824,4 +824,5 @@ export function register_click_handlers() {
export function initialize() {
rebuild_catalog();
register_click_handlers();
}

View File

@ -4,7 +4,7 @@ const {strict: assert} = require("assert");
const _ = require("lodash");
const {zrequire} = require("./lib/namespace");
const {zrequire, set_global} = require("./lib/namespace");
const {run_test} = require("./lib/test");
const emoji = zrequire("emoji");
@ -12,6 +12,8 @@ const emoji_picker = zrequire("emoji_picker");
const emoji_codes = zrequire("../../static/generated/emoji/emoji_codes.json");
set_global("document", "document-stub");
run_test("initialize", () => {
emoji.initialize({
realm_emoji: {},