diff --git a/docs/assets/themes/zeppelin/css/style.css b/docs/assets/themes/zeppelin/css/style.css index b07bc25ec45..408223500f6 100644 --- a/docs/assets/themes/zeppelin/css/style.css +++ b/docs/assets/themes/zeppelin/css/style.css @@ -2,6 +2,10 @@ @import url('../font/fonts-patua-one.css'); @import url('../font/fonts-open-sans.css'); +:root { + --navbar-height: 60px; +} + body { padding-top: 50px; padding-bottom: 20px; @@ -11,6 +15,10 @@ body { font-size: 15px; } +html { + scroll-padding-top: var(--navbar-height); +} + .jumbotron { background-color: #3071a9; } @@ -86,7 +94,7 @@ body { .navbar { background: #3071a9; border-bottom: 0px; - height: 60px; + height: var(--navbar-height); box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.4); } @@ -548,7 +556,7 @@ a.anchor { } .navbar-collapse.collapse { - max-height: 60px; + max-height: var(--navbar-height); } .navbar-inverse .navbar-nav a .caret, diff --git a/docs/assets/themes/zeppelin/js/docs.js b/docs/assets/themes/zeppelin/js/docs.js index 33863a367c7..faf57e413ba 100644 --- a/docs/assets/themes/zeppelin/js/docs.js +++ b/docs/assets/themes/zeppelin/js/docs.js @@ -96,15 +96,6 @@ function viewSolution() { }); } -// A script to fix internal hash links because we have an overlapping top bar. -// Based on https://github.com/twitter/bootstrap/issues/193#issuecomment-2281510 -function maybeScrollToHash() { - if (window.location.hash && $(window.location.hash).length) { - var newTop = $(window.location.hash).offset().top - 57; - $(window).scrollTop(newTop); - } -} - $(function() { codeTabs(); // Display anchor links when hovering over headers. For documentation of the @@ -114,10 +105,6 @@ $(function() { }; anchors.add(); - $(window).bind('hashchange', function() { - maybeScrollToHash(); - }); - $(document).ready(function() { $('#toc').toc(); }); @@ -131,7 +118,4 @@ $(function() { } }); - // Scroll now too in case we had opened the page on a hash, but wait a bit because some browsers - // will try to do *their* initial scroll after running the onReady handler. - $(window).load(function() { setTimeout(function() { maybeScrollToHash(); }, 25); }); });