Skip to content

Commit

Permalink
[FIXED JENKINS-13106] hitting / key puts / in the search box
Browse files Browse the repository at this point in the history
  • Loading branch information
jieryn committed Apr 4, 2012
1 parent ce2e4ad commit c31c3ba
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main/webapp/js/keyboard-shortcuts.js
Expand Up @@ -32,6 +32,11 @@ if (ks_enabled) {
Event.observe(document, 'keypress', ks_keypress);
});

/* JENKINS-13106 - event.stopPropagation() and event.cancelBubble=true both fail */
function clearSearchBox() {
Form.Element.clear('search-box');
}

/* try to play nicely with forms, so no keyboard shortcuts */
function ks_in_form() {
return document.activeElement == null || 'INPUT' == document.activeElement.tagName
Expand Down Expand Up @@ -226,6 +231,7 @@ if (ks_enabled) {

case '/':
$('search-box').focus();
setTimeout("clearSearchBox(/* someone kill me */)", 1);
break;

case 'b':
Expand Down

0 comments on commit c31c3ba

Please sign in to comment.