mirror of
https://github.com/minio/docs.git
synced 2025-08-06 14:42:56 +03:00
Fix anchor scrolling issue on Webkit browsers (#669)
This commit is contained in:
@@ -14,7 +14,7 @@ window.addEventListener("DOMContentLoaded", (event) => {
|
||||
})();
|
||||
|
||||
// --------------------------------------------------
|
||||
// Dynamic sidebar scroll on read-mode.
|
||||
// Dynamic sidebar scroll on non read-mode.
|
||||
// This'll allow the sidebar to display all content,
|
||||
// without scrolling the body.
|
||||
// --------------------------------------------------
|
||||
@@ -54,12 +54,21 @@ window.addEventListener("DOMContentLoaded", (event) => {
|
||||
|
||||
// Make the sidebar is scrollable.
|
||||
sidebarEl.classList.remove("inactive");
|
||||
|
||||
// Scroll to hash
|
||||
var hash = window.location.hash;
|
||||
if (hash) {
|
||||
var el = document.querySelector(hash);
|
||||
if (el) {
|
||||
el.scrollIntoView();
|
||||
}
|
||||
}
|
||||
}, 100);
|
||||
|
||||
document.addEventListener("scroll", (e) => {
|
||||
setSidebarHeight();
|
||||
});
|
||||
|
||||
|
||||
// --------------------------------------------------
|
||||
// Read mode
|
||||
// --------------------------------------------------
|
||||
|
Reference in New Issue
Block a user