mirror of
https://github.com/zulip/zulip.git
synced 2025-10-24 16:43:57 +00:00
refactor: Move click handlers to compose_closed_ui.js.
This commit is contained in:
@@ -638,28 +638,6 @@ export function initialize() {
|
|||||||
$("#nonexistent_stream_reply_error").stop(true).fadeOut(500);
|
$("#nonexistent_stream_reply_error").stop(true).fadeOut(500);
|
||||||
});
|
});
|
||||||
|
|
||||||
$("body").on("click", ".compose_stream_button", () => {
|
|
||||||
popovers.hide_mobile_message_buttons_popover();
|
|
||||||
compose_actions.start("stream", {trigger: "new topic button"});
|
|
||||||
});
|
|
||||||
$("body").on("click", ".compose_private_button", () => {
|
|
||||||
popovers.hide_mobile_message_buttons_popover();
|
|
||||||
compose_actions.start("private");
|
|
||||||
});
|
|
||||||
|
|
||||||
$("body").on("click", ".compose_mobile_stream_button", () => {
|
|
||||||
popovers.hide_mobile_message_buttons_popover();
|
|
||||||
compose_actions.start("stream", {trigger: "new topic button"});
|
|
||||||
});
|
|
||||||
$("body").on("click", ".compose_mobile_private_button", () => {
|
|
||||||
popovers.hide_mobile_message_buttons_popover();
|
|
||||||
compose_actions.start("private");
|
|
||||||
});
|
|
||||||
|
|
||||||
$("body").on("click", ".compose_reply_button", () => {
|
|
||||||
compose_actions.respond_to_message({trigger: "reply button"});
|
|
||||||
});
|
|
||||||
|
|
||||||
$("body").on("click", ".empty_feed_compose_stream", (e) => {
|
$("body").on("click", ".empty_feed_compose_stream", (e) => {
|
||||||
compose_actions.start("stream", {trigger: "empty feed message"});
|
compose_actions.start("stream", {trigger: "empty feed message"});
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
import $ from "jquery";
|
import $ from "jquery";
|
||||||
|
|
||||||
|
import * as compose_actions from "./compose_actions";
|
||||||
import * as message_lists from "./message_lists";
|
import * as message_lists from "./message_lists";
|
||||||
|
import * as popovers from "./popovers";
|
||||||
|
|
||||||
function update_reply_recipient_label() {
|
function update_reply_recipient_label() {
|
||||||
const message = message_lists.current.selected_message();
|
const message = message_lists.current.selected_message();
|
||||||
@@ -15,11 +17,34 @@ function update_reply_recipient_label() {
|
|||||||
$(".compose_reply_button_recipient_label").text(recipient_label);
|
$(".compose_reply_button_recipient_label").text(recipient_label);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Move the closed-compose buttons click handlers here, probably.
|
|
||||||
|
|
||||||
export function initialize() {
|
export function initialize() {
|
||||||
// When the message selection changes, change the label on the Reply button.
|
// When the message selection changes, change the label on the Reply button.
|
||||||
$(document).on("message_selected.zulip", () => {
|
$(document).on("message_selected.zulip", () => {
|
||||||
update_reply_recipient_label();
|
update_reply_recipient_label();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Click handlers for buttons in the compose compose box.
|
||||||
|
$("body").on("click", ".compose_stream_button", () => {
|
||||||
|
popovers.hide_mobile_message_buttons_popover();
|
||||||
|
compose_actions.start("stream", {trigger: "new topic button"});
|
||||||
|
});
|
||||||
|
|
||||||
|
$("body").on("click", ".compose_private_button", () => {
|
||||||
|
popovers.hide_mobile_message_buttons_popover();
|
||||||
|
compose_actions.start("private");
|
||||||
|
});
|
||||||
|
|
||||||
|
$("body").on("click", ".compose_mobile_stream_button", () => {
|
||||||
|
popovers.hide_mobile_message_buttons_popover();
|
||||||
|
compose_actions.start("stream", {trigger: "new topic button"});
|
||||||
|
});
|
||||||
|
|
||||||
|
$("body").on("click", ".compose_mobile_private_button", () => {
|
||||||
|
popovers.hide_mobile_message_buttons_popover();
|
||||||
|
compose_actions.start("private");
|
||||||
|
});
|
||||||
|
|
||||||
|
$("body").on("click", ".compose_reply_button", () => {
|
||||||
|
compose_actions.respond_to_message({trigger: "reply button"});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ EXEMPT_FILES = {
|
|||||||
"static/js/blueslip_stacktrace.ts",
|
"static/js/blueslip_stacktrace.ts",
|
||||||
"static/js/click_handlers.js",
|
"static/js/click_handlers.js",
|
||||||
"static/js/compose_actions.js",
|
"static/js/compose_actions.js",
|
||||||
|
"static/js/compose_closed_ui.js",
|
||||||
"static/js/composebox_typeahead.js",
|
"static/js/composebox_typeahead.js",
|
||||||
"static/js/compose_fade.js",
|
"static/js/compose_fade.js",
|
||||||
"static/js/compose.js",
|
"static/js/compose.js",
|
||||||
|
|||||||
Reference in New Issue
Block a user