mirror of
https://github.com/zulip/zulip.git
synced 2026-07-06 21:18:58 +08:00
recent_topics: Hide reply button when search or filters selected.
Since there is no context for a message in the search or filter buttons, we don't show reply button either of them are focused.
This commit is contained in:
parent
5040246474
commit
0dd8ce6ff9
@ -4,6 +4,16 @@ import * as compose_actions from "./compose_actions";
|
||||
import * as message_lists from "./message_lists";
|
||||
import * as popovers from "./popovers";
|
||||
|
||||
export function hide_reply_button() {
|
||||
$(".reply_button_container").hide();
|
||||
$("#compose_buttons").css("justify-content", "flex-end");
|
||||
}
|
||||
|
||||
export function show_reply_button() {
|
||||
$(".reply_button_container").show();
|
||||
$("#compose_buttons").css("justify-content", "flex-start");
|
||||
}
|
||||
|
||||
export function update_reply_recipient_label(message) {
|
||||
message = message || message_lists.current.selected_message();
|
||||
let recipient_label = "";
|
||||
|
||||
@ -106,6 +106,7 @@ export function set_default_focus() {
|
||||
// focused element, we switch focus to search.
|
||||
current_focus_elem = $("#recent_topics_search");
|
||||
current_focus_elem.trigger("focus");
|
||||
compose_closed_ui.hide_reply_button();
|
||||
}
|
||||
|
||||
function get_min_load_count(already_rendered_count, load_count) {
|
||||
@ -149,6 +150,7 @@ function set_table_focus(row, col) {
|
||||
stream: topic_row.find(".recent_topic_stream a").text(),
|
||||
topic: topic_row.find(".recent_topic_name a").text(),
|
||||
};
|
||||
compose_closed_ui.show_reply_button();
|
||||
compose_closed_ui.update_reply_recipient_label(message);
|
||||
|
||||
// focused topic can be under table `thead`
|
||||
@ -754,6 +756,7 @@ export function change_focused_element($elt, input_key) {
|
||||
// go away from the input box when `revive_current_focus` is called
|
||||
// on rerender when user is typing.
|
||||
current_focus_elem = $("#recent_topics_search");
|
||||
compose_closed_ui.hide_reply_button();
|
||||
return true;
|
||||
case "escape":
|
||||
if (is_table_focused()) {
|
||||
@ -856,6 +859,9 @@ export function change_focused_element($elt, input_key) {
|
||||
}
|
||||
if (current_focus_elem && input_key !== "escape") {
|
||||
current_focus_elem.trigger("focus");
|
||||
if (current_focus_elem.hasClass("btn-recent-filters")) {
|
||||
compose_closed_ui.hide_reply_button();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user