diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md index 37ad6e13..257b3ae8 100644 --- a/ARCHITECTURE.md +++ b/ARCHITECTURE.md @@ -2,7 +2,7 @@ This is a short overview of the general architecture and structure of the repository, to help you orient yourself. -This theme uses [sphinx-theme-builder](https://sphinx-theme-builder.readthedocs.io/en/latest/) as its build backend, and follows the [filesystem layout](https://sphinx-theme-builder.readthedocs.io/en/latest/reference/filesystem-layout/) recommended by it. +This theme uses [sphinx-theme-builder](https://sphinx-theme-builder.readthedocs.io/en/latest/) as its build backend, and follows the [filesystem layout](https://sphinx-theme-builder.readthedocs.io/en/latest/filesystem-layout/) recommended by it. See below for some more specific sections ```{contents} diff --git a/src/sphinx_book_theme/assets/scripts/index.js b/src/sphinx_book_theme/assets/scripts/index.js index a5b2a594..d3238aee 100644 --- a/src/sphinx_book_theme/assets/scripts/index.js +++ b/src/sphinx_book_theme/assets/scripts/index.js @@ -131,7 +131,11 @@ var initTocHide = () => { }; // Set up the intersection observer to watch all margin content - let tocObserver = new IntersectionObserver(hideTocCallback); + let options = { + // Trigger callback when the top of a margin item is 1/3 up the screen + rootMargin: "0px 0px -33% 0px", + }; + let tocObserver = new IntersectionObserver(hideTocCallback, options); // TODO: deprecate popout after v0.5.0 const selectorClasses = [ "marginnote",