mirror of
https://github.com/zulip/zulip.git
synced 2025-11-13 02:17:19 +00:00
search: Refactor how close buttons are handled.
We refactor the following inputs to use a `placeholder-shown` CSS selector to show/hide the close button, rather than custom JS logic: - Filter topics field in the left sidebar - Filter direct messages field under direct messages - Stream message topic
This commit is contained in:
@@ -512,21 +512,8 @@ export function initialize() {
|
||||
|
||||
$("#compose_recipient_box").on("click", "#recipient_box_clear_topic_button", () => {
|
||||
const $input = $("input#stream_message_recipient_topic");
|
||||
const $button = $("#recipient_box_clear_topic_button");
|
||||
|
||||
$input.val("");
|
||||
$input.trigger("focus");
|
||||
$button.hide();
|
||||
});
|
||||
|
||||
$("#compose_recipient_box").on("input", "input#stream_message_recipient_topic", (e) => {
|
||||
const $button = $("#recipient_box_clear_topic_button");
|
||||
const value = $(e.target).val();
|
||||
if (value.length === 0) {
|
||||
$button.hide();
|
||||
} else {
|
||||
$button.show();
|
||||
}
|
||||
});
|
||||
|
||||
$("input#stream_message_recipient_topic").on("focus", () => {
|
||||
|
||||
Reference in New Issue
Block a user