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,
|
// This'll allow the sidebar to display all content,
|
||||||
// without scrolling the body.
|
// without scrolling the body.
|
||||||
// --------------------------------------------------
|
// --------------------------------------------------
|
||||||
@@ -54,12 +54,21 @@ window.addEventListener("DOMContentLoaded", (event) => {
|
|||||||
|
|
||||||
// Make the sidebar is scrollable.
|
// Make the sidebar is scrollable.
|
||||||
sidebarEl.classList.remove("inactive");
|
sidebarEl.classList.remove("inactive");
|
||||||
|
|
||||||
|
// Scroll to hash
|
||||||
|
var hash = window.location.hash;
|
||||||
|
if (hash) {
|
||||||
|
var el = document.querySelector(hash);
|
||||||
|
if (el) {
|
||||||
|
el.scrollIntoView();
|
||||||
|
}
|
||||||
|
}
|
||||||
}, 100);
|
}, 100);
|
||||||
|
|
||||||
document.addEventListener("scroll", (e) => {
|
document.addEventListener("scroll", (e) => {
|
||||||
setSidebarHeight();
|
setSidebarHeight();
|
||||||
});
|
});
|
||||||
|
|
||||||
// --------------------------------------------------
|
// --------------------------------------------------
|
||||||
// Read mode
|
// Read mode
|
||||||
// --------------------------------------------------
|
// --------------------------------------------------
|
||||||
|
@@ -48,6 +48,8 @@
|
|||||||
.content {
|
.content {
|
||||||
@include breakpoint-min(breakpoints(lg)) {
|
@include breakpoint-min(breakpoints(lg)) {
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
|
scroll-behavior: smooth;
|
||||||
|
scroll-padding: 2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
& > .container {
|
& > .container {
|
||||||
|
Reference in New Issue
Block a user