0
0
mirror of https://github.com/go-gitea/gitea.git synced 2026-04-09 10:55:26 +02:00

Update web_src/js/features/file-view.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: hamkido <hamki.do2000@gmail.com>
This commit is contained in:
hamkido 2026-01-26 17:17:15 +08:00 committed by GitHub
parent 82a91140bf
commit 6a5ea3b2f3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -170,8 +170,8 @@ function initSidebarToggle(elFileView: HTMLElement): void {
const fileHeader = elFileView.querySelector('.file-header');
const segment = elFileView.querySelector('.ui.bottom.segment');
if (fileHeader && segment) {
// Use many thresholds to get fine-grained position updates during scroll
const thresholds = Array.from({length: 101}, (_, i) => i / 100);
// Use a small set of thresholds to get periodic position updates during scroll
const thresholds = [0, 0.25, 0.5, 0.75, 1];
const positionObserver = new IntersectionObserver(() => {
updatePosition();
}, {threshold: thresholds});