Have ESC key clear people searches.

(imported from commit a3f4cf0416f4f2ea76660bf68790988edc5675e2)
This commit is contained in:
Steve Howell 2014-01-14 11:36:52 -05:00 committed by Tim Abbott
parent fafb6f3bb5
commit aae001fa8e
2 changed files with 11 additions and 0 deletions

View File

@ -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);

View File

@ -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();