Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Lednerb/bilberry-hugo-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'assets/js/theme.js')
-rw-r--r--assets/js/theme.js15
1 files changed, 9 insertions, 6 deletions
diff --git a/assets/js/theme.js b/assets/js/theme.js
index cba8207..5f30857 100644
--- a/assets/js/theme.js
+++ b/assets/js/theme.js
@@ -86,14 +86,17 @@ $(document).ready(function () {
// Keyboard-Support
$(document).keyup(function (e) {
- if (e.keyCode === 27) {
- if (!$("nav").hasClass('permanentTopNav'))
+ if (e.code === 'Escape') {
+ if (!$("nav").hasClass('permanentTopNav')) {
$("nav").slideUp();
- $("#search").autocomplete("val", "");
- }
- else if (e.keyCode === 83 && !blockSearchFocusCommento || !blockSearchFocusUtterances || !blockSearchFocusGiscus) {
- if (!$("nav").hasClass('permanentTopNav'))
+ }
+ $("#search").autocomplete("val", "").blur();
+ } else if (e.code === 'KeyS' && (!blockSearchFocusCommento
+ || !blockSearchFocusUtterances || !blockSearchFocusGiscus)) {
+
+ if (!$("nav").hasClass('permanentTopNav')) {
$("nav").slideDown();
+ }
$("#search").focus();
}
})