mirror of
https://github.com/zulip/zulip.git
synced 2025-11-13 18:36:36 +00:00
compose: Name triggers for clearing the topic.
This commit is contained in:
@@ -169,7 +169,7 @@ export function initialize() {
|
||||
|
||||
// Click handlers for buttons in the compose box.
|
||||
$("body").on("click", ".compose_stream_button", () => {
|
||||
compose_actions.start("stream", {trigger: "new topic button"});
|
||||
compose_actions.start("stream", {trigger: "clear topic button"});
|
||||
});
|
||||
|
||||
$("body").on("click", ".compose_private_button", () => {
|
||||
|
||||
@@ -43,7 +43,7 @@ export function initialize() {
|
||||
onMount(instance) {
|
||||
const $popper = $(instance.popper);
|
||||
$popper.one("click", ".compose_mobile_stream_button", (e) => {
|
||||
compose_actions.start("stream", {trigger: "new topic button"});
|
||||
compose_actions.start("stream", {trigger: "clear topic button"});
|
||||
e.stopPropagation();
|
||||
instance.hide();
|
||||
});
|
||||
|
||||
@@ -51,7 +51,7 @@ function get_focus_area(msg_type, opts) {
|
||||
(msg_type === "stream" && opts.stream_id) ||
|
||||
(msg_type === "private" && opts.private_message_recipient)
|
||||
) {
|
||||
if (opts.trigger === "new topic button") {
|
||||
if (opts.trigger === "clear topic button") {
|
||||
return "#stream_message_recipient_topic";
|
||||
}
|
||||
return "#compose-textarea";
|
||||
|
||||
@@ -152,7 +152,7 @@ test("start", ({override, override_rewire, mock_template}) => {
|
||||
stream_data.add_sub(denmark);
|
||||
|
||||
compose_defaults = {
|
||||
trigger: "new topic button",
|
||||
trigger: "clear topic button",
|
||||
};
|
||||
|
||||
opts = {};
|
||||
|
||||
@@ -886,7 +886,7 @@ run_test("get_focus_area", () => {
|
||||
get_focus_area("stream", {
|
||||
stream_id: 4,
|
||||
topic: "more",
|
||||
trigger: "new topic button",
|
||||
trigger: "clear topic button",
|
||||
}),
|
||||
"#stream_message_recipient_topic",
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user