This is an automated email from the ASF dual-hosted git repository.
niallp pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/griffin-site.git
The following commit(s) were added to refs/heads/master by this push:
new 7ef50eb Fix broken navigation script
7ef50eb is described below
commit 7ef50eb0c1d783a321cebc1cd798e6e28b77a8ab
Author: Niall Pemberton <[email protected]>
AuthorDate: Thu Nov 20 15:33:41 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>