mirror of
https://github.com/danog/sass-site.git
synced 2024-12-11 17:09:52 +01:00
14 lines
385 B
JavaScript
14 lines
385 B
JavaScript
|
$(document).keydown(function(event) {
|
||
|
// We aren't interested in any modified keys.
|
||
|
if (event.shiftKey || event.altKey || event.ctrlKey || event.metaKey) {
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
// Forward slash or "s" focus the search bar.
|
||
|
if ((event.which == 191 || event.which == 83) &&
|
||
|
event.target.tagName !== "INPUT") {
|
||
|
$("input.search").focus();
|
||
|
event.preventDefault();
|
||
|
}
|
||
|
});
|