You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datasketches.apache.org by le...@apache.org on 2020/07/13 18:12:19 UTC

[incubator-datasketches-website] branch master updated: search for links only inside the TOC & highlight nav links

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

leerho pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-datasketches-website.git


The following commit(s) were added to refs/heads/master by this push:
     new 526b0e5  search for links only inside the TOC & highlight nav links
     new 38d3500  Merge pull request #93 from mkaszas/mkaszas/nav-toc-highlight
526b0e5 is described below

commit 526b0e5392ff85153f9bc2084416c41dee7c4d2d
Author: Mate Kaszas <ma...@gmail.com>
AuthorDate: Mon Jul 13 19:31:23 2020 +0200

    search for links only inside the TOC & highlight nav links
---
 _includes/tocScript.html | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/_includes/tocScript.html b/_includes/tocScript.html
index 60194e3..a0df8aa 100644
--- a/_includes/tocScript.html
+++ b/_includes/tocScript.html
@@ -3,9 +3,13 @@
   (function () {
 
     var findLineItem = function (path) {
-      return document.querySelector(`[href="${path}"]`);
+      return document.querySelector(`#toc [href="${path}"]`);
     };
 
+    function findNavItem(path) {
+      return document.querySelector(`.nav [href="${path}"]`);
+    }
+
     var highlighLineItem = function (element) {
       element.classList.add('highlight');
     };
@@ -36,9 +40,13 @@
     };
 
     var highlightAndOpenMenu = function () {
+      // Highlight & expand nav item in the TOC
       var currentLineItem = findLineItem(document.location.pathname);
       highlighLineItem(currentLineItem);
       openAllFromList(findAllCollapseParents(currentLineItem));
+
+      // Highlight nav item in top navigation
+      highlighLineItem(findNavItem(document.location.pathname));
     };
 
     $(highlightAndOpenMenu);


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org