Skip to content

Commit

Permalink
minor update
Browse files Browse the repository at this point in the history
  • Loading branch information
ain-soph committed Oct 19, 2021
1 parent 1eb2be5 commit a4ef763
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions js/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
},
Expand Down Expand Up @@ -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)
}
Expand Down
6 changes: 3 additions & 3 deletions trojanzoo_sphinx_theme/static/js/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
},
Expand Down Expand Up @@ -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)
}
Expand Down

0 comments on commit a4ef763

Please sign in to comment.