mirror of
https://github.com/go-gitea/gitea.git
synced 2026-05-20 17:55:42 +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 fileHeader = elFileView.querySelector('.file-header');
|
||||||
const segment = elFileView.querySelector('.ui.bottom.segment');
|
const segment = elFileView.querySelector('.ui.bottom.segment');
|
||||||
if (fileHeader && segment) {
|
if (fileHeader && segment) {
|
||||||
// Use many thresholds to get fine-grained position updates during scroll
|
// Use a small set of thresholds to get periodic position updates during scroll
|
||||||
const thresholds = Array.from({length: 101}, (_, i) => i / 100);
|
const thresholds = [0, 0.25, 0.5, 0.75, 1];
|
||||||
const positionObserver = new IntersectionObserver(() => {
|
const positionObserver = new IntersectionObserver(() => {
|
||||||
updatePosition();
|
updatePosition();
|
||||||
}, {threshold: thresholds});
|
}, {threshold: thresholds});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user