mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 21:43:21 +00:00
left_sidebar: Show the search bar all the time.
This is preparation for adding channel folders to the sidebar and removing the CHANNELS header, where we'll want to have an always open search bar.
This commit is contained in:
@@ -923,7 +923,7 @@ function on_sidebar_channel_click(
|
||||
e: JQuery.ClickEvent | null,
|
||||
show_channel_feed: (stream_id: number, trigger: string) => void,
|
||||
): void {
|
||||
clear_and_hide_search();
|
||||
clear_search();
|
||||
if (e !== null) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
@@ -1126,21 +1126,8 @@ export function test_clear_search(): void {
|
||||
update_streams_for_search();
|
||||
}
|
||||
|
||||
export function show_search_section(): void {
|
||||
$("#streams_header").addClass("showing-stream-search-section");
|
||||
$(".stream_search_section").expectOne().removeClass("notdisplayed");
|
||||
resize.resize_stream_filters_container();
|
||||
}
|
||||
|
||||
export function hide_search_section(): void {
|
||||
$("#streams_header").removeClass("showing-stream-search-section");
|
||||
$(".stream_search_section").expectOne().addClass("notdisplayed");
|
||||
resize.resize_stream_filters_container();
|
||||
}
|
||||
|
||||
export function initiate_search(): void {
|
||||
popovers.hide_all();
|
||||
show_search_section();
|
||||
|
||||
const $filter = $(".stream-list-filter").expectOne();
|
||||
|
||||
@@ -1150,7 +1137,7 @@ export function initiate_search(): void {
|
||||
stream_cursor.reset();
|
||||
}
|
||||
|
||||
export function clear_and_hide_search(): void {
|
||||
export function clear_search(): void {
|
||||
const $filter = $(".stream-list-filter").expectOne();
|
||||
if ($filter.val() !== "") {
|
||||
$filter.val("");
|
||||
@@ -1158,17 +1145,6 @@ export function clear_and_hide_search(): void {
|
||||
}
|
||||
stream_cursor.clear();
|
||||
$filter.trigger("blur");
|
||||
|
||||
hide_search_section();
|
||||
}
|
||||
|
||||
export function toggle_filter_displayed(e: JQuery.ClickEvent): void {
|
||||
if ($(".stream_search_section.notdisplayed").length === 0) {
|
||||
clear_and_hide_search();
|
||||
} else {
|
||||
initiate_search();
|
||||
}
|
||||
e.preventDefault();
|
||||
}
|
||||
|
||||
function scroll_stream_into_view($stream_li: JQuery): void {
|
||||
|
||||
Reference in New Issue
Block a user