mirror of
https://github.com/danog/sass-site.git
synced 2024-12-17 11:57:21 +01:00
7a2aa57b96
Closes #345
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();
|
|
}
|
|
});
|