Don't re-focus on the search box after ending the search.

(imported from commit 35bffb245ad9dc58b394a1c5228b32db4830f2bd)
This commit is contained in:
Jessica McKellar 2012-11-01 12:14:33 -04:00
parent 9ec6b80019
commit c1cc9f0742
3 changed files with 7 additions and 2 deletions

View File

@ -28,6 +28,7 @@ var globals =
// search.js
+ ' search_button_handler something_is_highlighted update_highlight_on_narrow'
+ ' initiate_search'
// setup.js
+ ' loading_spinner templates'

View File

@ -114,7 +114,7 @@ function process_hotkey(code) {
respond_to_message("personal");
return process_hotkey;
case 47: // '/': initiate search
clear_search();
initiate_search();
return process_hotkey;
case 63: // '?': Show keyboard shortcuts page
$('#keyboard-shortcuts').modal('show');

View File

@ -92,9 +92,13 @@ function clear_search_cache() {
cached_term = "";
}
function initiate_search() {
$('#search').val('').focus();
}
function clear_search() {
$('table tr').removeHighlight();
$('#search').val('').focus();
$('#search').val('');
clear_search_cache();
}