MCPcopy Create free account
hub / github.com/Tampermonkey/tampermonkey / scrollIntoView

Function scrollIntoView

src/cm/codemirror.js:1018–1022  ·  view source on GitHub ↗
(x1, y1, x2, y2)

Source from the content-addressed store, hash-verified

1016 return {x: x, y: cursor.y, yBot: cursor.yBot};
1017 }
1018 function scrollIntoView(x1, y1, x2, y2) {
1019 var scrollPos = calculateScrollPos(x1, y1, x2, y2);
1020 if (scrollPos.scrollLeft != null) {scroller.scrollLeft = scrollPos.scrollLeft;}
1021 if (scrollPos.scrollTop != null) {scrollbar.scrollTop = scroller.scrollTop = scrollPos.scrollTop;}
1022 }
1023 function calculateScrollPos(x1, y1, x2, y2) {
1024 var pl = paddingLeft(), pt = paddingTop();
1025 y1 += pt; y2 += pt; x1 += pl; x2 += pl;

Callers 2

CodeMirrorFunction · 0.85
scrollCursorIntoViewFunction · 0.85

Calls 1

calculateScrollPosFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…