This is an automated email from the ASF dual-hosted git repository.

tbonelee pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/zeppelin.git


The following commit(s) were added to refs/heads/master by this push:
     new 2919b442bd [ZEPPELIN-6629] Fix anchor links hidden under navbar
2919b442bd is described below

commit 2919b442bd86cdcaeadb557e162194d4696d0165
Author: Naeun Park <[email protected]>
AuthorDate: Mon Oct 5 22:42:12 2026 +0900

    [ZEPPELIN-6629] Fix anchor links hidden under navbar
    
    ### What is this PR for?
    
    Anchor links in the documentation can be hidden behind the fixed 60px 
navbar.
    
    The existing `maybeScrollToHash()` JavaScript workaround uses a hardcoded 
57px offset and does not handle explicit named anchors such as `<a name="S3">`.
    
    This PR replaces the JavaScript workaround with `scroll-padding-top: 60px`, 
allowing native fragment navigation to account for the fixed navbar. It also 
removes `maybeScrollToHash()` and its related event handlers.
    
    ### What type of PR is it?
    
    Bug Fix
    
    ### What is the Jira issue?
    
    https://issues.apache.org/jira/browse/ZEPPELIN-6629
    
    ### How should this be tested?
    
    Run the documentation site locally and verify the following fragments on 
the Notebook Storage page:
    
    * `#overview`
    * `#notebook-storage-in-s3`
    * `#S3`
    
    Verify that each target is visible below the fixed navbar.
    
    Also verify the behavior with a mobile-width viewport.
    
    ### Screenshots
    
    Before/after screenshots for `#S3`, if appropriate.
    
    ### Questions
    
    * Does the licenses files need update? No.
    * Is there breaking changes for older versions? No.
    * Does this needs documentation? No.
    
    
    Closes #5407 from world970511/ZEPPELIN-6629.
    
    Signed-off-by: ChanHo Lee <[email protected]>
---
 docs/assets/themes/zeppelin/css/style.css | 12 ++++++++++--
 docs/assets/themes/zeppelin/js/docs.js    | 16 ----------------
 2 files changed, 10 insertions(+), 18 deletions(-)

diff --git a/docs/assets/themes/zeppelin/css/style.css 
b/docs/assets/themes/zeppelin/css/style.css
index b07bc25ec4..408223500f 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 33863a367c..faf57e413b 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); });
 });

Reply via email to