diff --git a/src/theme/book.css b/src/theme/book.css index 80160288..1efbfb85 100644 --- a/src/theme/book.css +++ b/src/theme/book.css @@ -220,6 +220,7 @@ html:not(.sidebar-visible) #menu-bar:not(:hover).folded > #menu-bar-sticky-conta overflow: hidden; -o-text-overflow: ellipsis; text-overflow: ellipsis; + cursor: pointer; } .nav-chapters { font-size: 2.5em; diff --git a/src/theme/book.js b/src/theme/book.js index 489d994a..53806af0 100644 --- a/src/theme/book.js +++ b/src/theme/book.js @@ -522,6 +522,14 @@ function playpen_text(playpen) { }); })(); +(function scrollToTop () { + var menuTitle = document.querySelector('.menu-title'); + + menuTitle.addEventListener('click', function () { + document.scrollingElement.scrollTo({ top: 0, behavior: 'smooth' }); + }); +})(); + (function autoHideMenu() { var menu = document.getElementById('menu-bar'); diff --git a/src/theme/stylus/menu.styl b/src/theme/stylus/menu.styl index eae9469a..e50987b5 100644 --- a/src/theme/stylus/menu.styl +++ b/src/theme/stylus/menu.styl @@ -38,4 +38,5 @@ html:not(.sidebar-visible) #menu-bar:not(:hover).folded > #menu-bar-sticky-conta white-space: nowrap overflow: hidden text-overflow: ellipsis + cursor: pointer; }