Limit "auto scroll ToC" to Chromium-based
This commit is contained in:
parent
70462d0e16
commit
573f286971
@ -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
|
||||
|
||||
|
@ -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
|
||||
$(
|
||||
|
2
assets/js/main.min.js
vendored
2
assets/js/main.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user