Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -195,4 +195,16 @@ $(document).ready(function() {
servershell.term = url.searchParams.get('term');
servershell.submit_search(false, false);
})

$(document).on('keypress', (event) => {
if (event.key === '/') {
// We want to skip the cases where a user is typing / inside a textfield
// But we still want it to work in cases where the user just ticked a checkbox
if ($('input:focus:not([type=checkbox]), textarea:focus').length !== 0) {
return;
}
event.preventDefault(); // Prevent i.e. Firefox's quick search
$('#term').focus();
}
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
<hr>
<b>Keyboard Shortcuts</b>
<ul>
<li><kbd>/</kbd> Goto search field</li>
<li><kbd>TAB</kbd> Goto next input</li>
<li><kbd>SHIFT + TAB</kbd> Goto previous input</li>
<li><kbd>ESC</kbd> Close focus from input</li>
Expand Down
Loading