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

@ -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