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:
parent
82a91140bf
commit
6a5ea3b2f3
@ -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});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user