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

niallp pushed a commit to branch asf-site
in repository https://gitbox.apache.org/repos/asf/griffin-site.git


The following commit(s) were added to refs/heads/asf-site by this push:
     new 48bf613  Fix broken navigation script
48bf613 is described below

commit 48bf6139c9f9ad487d4f77801763370b97ba9e80
Author: Niall Pemberton <[email protected]>
AuthorDate: Thu Nov 20 15:34:18 2025 +0000

    Fix broken navigation script
---
 index.html | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/index.html b/index.html
index ccb95b2..320171a 100755
--- a/index.html
+++ b/index.html
@@ -304,9 +304,9 @@ under the License.
         menuItems = topMenu.find("a"),
         // Anchors corresponding to menu items
         scrollItems = menuItems.map(function () {
-            var item = $($(this).attr("href"));
-            if (item.length) {
-                return item;
+            var item = $(this).attr("href");
+            if (item.startsWith("#") && $(item).length) {
+                return $(item);
             }
         });
 
@@ -332,12 +332,15 @@ under the License.
         // Get the id of the current element
         cur = cur[cur.length - 1];
         var id = cur && cur.length ? cur[0].id : "";
+        if (!lastId) {
+           lastId = "home_page";
+        }
         if (lastId !== id) {
-            lastId = id;
             // Set/remove active class
             menuItems
                 .parent().removeClass("active")
-                .end().filter("[href=#" + id + 
"]").parent().addClass("active");
+                .end().filter("[href=\"#" + id + 
"\"]").parent().addClass("active");
+            lastId = id;
         }
     });
 </script>

Reply via email to