compose: Name triggers for clearing the topic.

This commit is contained in:
Karl Stolley
2023-10-03 14:43:55 -05:00
committed by Tim Abbott
parent 5b82a62b26
commit 5b830a226c
5 changed files with 5 additions and 5 deletions

View File

@@ -169,7 +169,7 @@ export function initialize() {
// Click handlers for buttons in the compose box. // Click handlers for buttons in the compose box.
$("body").on("click", ".compose_stream_button", () => { $("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", () => { $("body").on("click", ".compose_private_button", () => {

View File

@@ -43,7 +43,7 @@ export function initialize() {
onMount(instance) { onMount(instance) {
const $popper = $(instance.popper); const $popper = $(instance.popper);
$popper.one("click", ".compose_mobile_stream_button", (e) => { $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(); e.stopPropagation();
instance.hide(); instance.hide();
}); });

View File

@@ -51,7 +51,7 @@ function get_focus_area(msg_type, opts) {
(msg_type === "stream" && opts.stream_id) || (msg_type === "stream" && opts.stream_id) ||
(msg_type === "private" && opts.private_message_recipient) (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 "#stream_message_recipient_topic";
} }
return "#compose-textarea"; return "#compose-textarea";

View File

@@ -152,7 +152,7 @@ test("start", ({override, override_rewire, mock_template}) => {
stream_data.add_sub(denmark); stream_data.add_sub(denmark);
compose_defaults = { compose_defaults = {
trigger: "new topic button", trigger: "clear topic button",
}; };
opts = {}; opts = {};

View File

@@ -886,7 +886,7 @@ run_test("get_focus_area", () => {
get_focus_area("stream", { get_focus_area("stream", {
stream_id: 4, stream_id: 4,
topic: "more", topic: "more",
trigger: "new topic button", trigger: "clear topic button",
}), }),
"#stream_message_recipient_topic", "#stream_message_recipient_topic",
); );