Skip to content

Commit 81f3687

Browse files
authored
Merge branch 'dev' into fix/sonarqube-optional-service-key
2 parents 699d0fe + 22bf8a8 commit 81f3687

25 files changed

Lines changed: 1558 additions & 246 deletions

docs/assets/js/custom.js

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
console.log("[VersionToggle] Setting version to:", version);
1212

1313
document.querySelectorAll(".version-opensource, .version-pro").forEach(el => {
14-
el.style.display = el.classList.contains(`version-${version}`) ? "" : "none";
14+
el.style.display = el.classList.contains(`version-${version}`) ? "block" : "none";
1515
});
1616

1717
localStorage.setItem("version", version);
@@ -58,3 +58,35 @@
5858
observer.observe(document.body, { childList: true, subtree: true });
5959

6060
})();
61+
62+
63+
// Scroll progress bar — shows reading progress on doc pages
64+
(() => {
65+
"use strict";
66+
67+
const init = () => {
68+
// Only add on doc pages (pages with .docs-content)
69+
if (!document.querySelector('.docs-content')) return;
70+
71+
const bar = document.createElement('div');
72+
bar.className = 'scroll-progress';
73+
bar.style.width = '0%';
74+
document.body.appendChild(bar);
75+
76+
const update = () => {
77+
const scrollTop = window.scrollY;
78+
const docHeight = document.documentElement.scrollHeight - window.innerHeight;
79+
const progress = docHeight > 0 ? (scrollTop / docHeight) * 100 : 0;
80+
bar.style.width = progress + '%';
81+
};
82+
83+
window.addEventListener('scroll', update, { passive: true });
84+
update();
85+
};
86+
87+
if (document.readyState === 'loading') {
88+
document.addEventListener('DOMContentLoaded', init);
89+
} else {
90+
init();
91+
}
92+
})();

0 commit comments

Comments
 (0)