Limit "auto scroll ToC" to Chromium-based

This commit is contained in:
iBug 2024-05-07 14:20:45 +08:00
parent 70462d0e16
commit 573f286971
5 changed files with 12 additions and 5 deletions

View File

@ -6,6 +6,7 @@
- Disable copy button on invalid syntax highlighting blocks to avoid positioning issues.
- Fix typo for `fa-dribble` in `_utilities.scss`.
- Restrict "auto scroll sticky ToC to content" feature to Chromium browsers for now. [#4826](https://github.com/mmistakes/minimal-mistakes/issues/4826)
### Documentation & Maintenance

View File

@ -61,7 +61,7 @@ $(document).ready(function () {
}
// Auto scroll sticky ToC with content
document.addEventListener("gumshoeActivate", function (event) {
const scrollTocToContent = function (event) {
var target = event.target;
var scrollOptions = { behavior: "auto", block: "nearest", inline: "start" };
@ -75,7 +75,12 @@ $(document).ready(function () {
} else {
target.scrollIntoView(scrollOptions);
}
});
};
// Has issues on Firefox, whitelist Chrome for now
if (!!window.chrome) {
document.addEventListener("gumshoeActivate", scrollTocToContent);
}
// add lightbox class to all image links
$(

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -5,7 +5,7 @@ permalink: "/docs/history/"
excerpt: Change log of enhancements and bug fixes made to the theme.
sidebar:
nav: docs
last_modified_at: '2024-05-06T21:37:37+08:00'
last_modified_at: '2024-05-07T14:20:29+08:00'
toc: false
---
@ -21,6 +21,7 @@ toc: false
- Disable copy button on invalid syntax highlighting blocks to avoid positioning issues.
- Fix typo for `fa-dribble` in `_utilities.scss`.
- Restrict "auto scroll sticky ToC to content" feature to Chromium browsers for now. [#4826](https://github.com/mmistakes/minimal-mistakes/issues/4826)
### Documentation & Maintenance