mirror of
https://github.com/zulip/zulip.git
synced 2025-11-14 02:48:00 +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.
|
// 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", () => {
|
||||||
|
|||||||
@@ -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();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -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";
|
||||||
|
|||||||
@@ -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 = {};
|
||||||
|
|||||||
@@ -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",
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user