diff --git a/src/theme/book.css b/src/theme/book.css index 970ae36e..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; } @@ -408,6 +409,7 @@ table thead td { } .light pre > .buttons { position: absolute; + z-index: 100; right: 5px; top: 5px; color: #364149; @@ -527,6 +529,7 @@ table thead td { } .coal pre > .buttons { position: absolute; + z-index: 100; right: 5px; top: 5px; color: #a1adb8; @@ -646,6 +649,7 @@ table thead td { } .navy pre > .buttons { position: absolute; + z-index: 100; right: 5px; top: 5px; color: #c8c9db; @@ -765,6 +769,7 @@ table thead td { } .rust pre > .buttons { position: absolute; + z-index: 100; right: 5px; top: 5px; color: #c8c9db; @@ -884,6 +889,7 @@ table thead td { } .ayu pre > .buttons { position: absolute; + z-index: 100; right: 5px; top: 5px; color: #c8c9db; diff --git a/src/theme/book.js b/src/theme/book.js index 86b47d09..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); @@ -201,7 +202,7 @@ $( document ).ready(function() { var clipboardSnippets = new Clipboard('.clip-button', { text: function(trigger) { hideTooltip(trigger); - return trigger.parentElement.parentElement.textContent; + return $(trigger).parents(".playpen").find("code.language-rust.hljs")[0].textContent; } }); clipboardSnippets.on('success', function(e) { diff --git a/src/theme/index.hbs b/src/theme/index.hbs index 43b8f4cb..467d2fe6 100644 --- a/src/theme/index.hbs +++ b/src/theme/index.hbs @@ -76,7 +76,7 @@
-
+