From a4ef76316c69163f5821b0993d254c18f1bae6c7 Mon Sep 17 00:00:00 2001 From: ain-soph Date: Tue, 19 Oct 2021 18:19:15 -0400 Subject: [PATCH] minor update --- js/theme.js | 6 +++--- trojanzoo_sphinx_theme/static/js/theme.js | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/js/theme.js b/js/theme.js index 91138df..b486f67 100644 --- a/js/theme.js +++ b/js/theme.js @@ -373,7 +373,7 @@ makeHighlight = function(item) { } $(item).addClass("side-scroll-highlight"); var parent = findParent(item); - if (parent.length && !parent.hasClass("title-link")) { + if (parent.length) { makeHighlight(parent) } }, @@ -408,9 +408,9 @@ initHighlight = function() { $(window).scroll(function() { $(Object.keys(scrollItems).join(', ')).each(function () { - var menu_item = scrollItems['#' + this.id.replaceAll('.', '\\.')] var offsetScroll = $(this).offset().top - $(window).scrollTop() - utilities.getFixedOffset(); - if (offsetScroll <= 20 && offsetScroll >= -20) { + if (offsetScroll <= 30 && offsetScroll >= -30) { + var menu_item = scrollItems['#' + this.id.replaceAll('.', '\\.')] if (!$(menu_item).hasClass("side-scroll-highlight")){ showHighlight(menu_item) } diff --git a/trojanzoo_sphinx_theme/static/js/theme.js b/trojanzoo_sphinx_theme/static/js/theme.js index 6154085..1226252 100644 --- a/trojanzoo_sphinx_theme/static/js/theme.js +++ b/trojanzoo_sphinx_theme/static/js/theme.js @@ -1007,7 +1007,7 @@ makeHighlight = function(item) { } $(item).addClass("side-scroll-highlight"); var parent = findParent(item); - if (parent.length && !parent.hasClass("title-link")) { + if (parent.length) { makeHighlight(parent) } }, @@ -1042,9 +1042,9 @@ initHighlight = function() { $(window).scroll(function() { $(Object.keys(scrollItems).join(', ')).each(function () { - var menu_item = scrollItems['#' + this.id.replaceAll('.', '\\.')] var offsetScroll = $(this).offset().top - $(window).scrollTop() - utilities.getFixedOffset(); - if (offsetScroll <= 20 && offsetScroll >= -20) { + if (offsetScroll <= 30 && offsetScroll >= -30) { + var menu_item = scrollItems['#' + this.id.replaceAll('.', '\\.')] if (!$(menu_item).hasClass("side-scroll-highlight")){ showHighlight(menu_item) }