mirror of https://github.com/zulip/zulip.git
Have ESC key clear people searches.
(imported from commit a3f4cf0416f4f2ea76660bf68790988edc5675e2)
This commit is contained in:
parent
fafb6f3bb5
commit
aae001fa8e
|
@ -358,6 +358,14 @@ exports.set_user_statuses = function (users, server_time) {
|
|||
exports.update_huddles();
|
||||
};
|
||||
|
||||
exports.searching = function () {
|
||||
return $('.user-list-filter').expectOne().is(':focus');
|
||||
};
|
||||
|
||||
exports.clear_search = function () {
|
||||
$('.user-list-filter').val('');
|
||||
update_users_for_search();
|
||||
};
|
||||
|
||||
$(function () {
|
||||
$(".user-list-filter").expectOne().on('input', update_users_for_search);
|
||||
|
|
|
@ -192,6 +192,9 @@ function process_hotkey(e) {
|
|||
} else if ($(".message_edit_content").filter(":focus").length > 0) {
|
||||
row = $(".message_edit_content").filter(":focus").closest(".message_row");
|
||||
message_edit.end(row);
|
||||
} else if (activity.searching()) {
|
||||
activity.clear_search();
|
||||
return true;
|
||||
} else if (compose.composing()) {
|
||||
// If the user hit the escape key, cancel the current compose
|
||||
compose.cancel();
|
||||
|
|
Loading…
Reference in New Issue