From c1c06d6dc1f3745377940be6ab2d6ca8561b07bd Mon Sep 17 00:00:00 2001 From: Michal Budzynski Date: Thu, 15 Jun 2017 21:12:28 +0200 Subject: [PATCH] Auto focus on content to allow keyboard navigation --- src/theme/book.css | 1 + src/theme/book.js | 5 +++-- src/theme/index.hbs | 2 +- src/theme/stylus/page.styl | 1 + 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/theme/book.css b/src/theme/book.css index 6d3db97f..1dbd1ecd 100644 --- a/src/theme/book.css +++ b/src/theme/book.css @@ -137,6 +137,7 @@ table thead td { right: 0; left: 0; bottom: 0; + outline: 0; padding-right: 15px; overflow-y: auto; } diff --git a/src/theme/book.js b/src/theme/book.js index 8b1cdc15..c6161d91 100644 --- a/src/theme/book.js +++ b/src/theme/book.js @@ -52,8 +52,9 @@ $( document ).ready(function() { // Interesting DOM Elements var sidebar = $("#sidebar"); - var page_wrapper = $("#page-wrapper"); - var content = $("#content"); + + // Help keyboard navigation by always focusing on page content + $(".page").focus(); // Toggle sidebar $("#sidebar-toggle").click(sidebarToggle); diff --git a/src/theme/index.hbs b/src/theme/index.hbs index bf316f5f..81381b65 100644 --- a/src/theme/index.hbs +++ b/src/theme/index.hbs @@ -76,7 +76,7 @@
-
+