MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / scrollIntoView

Function scrollIntoView

lib/web/CodeMirror/src/display/scrolling.js:69–73  ·  view source on GitHub ↗
(cm, rect)

Source from the content-addressed store, hash-verified

67
68// Scroll a given set of coordinates into view (immediately).
69export function scrollIntoView(cm, rect) {
70 let scrollPos = calculateScrollPos(cm, rect)
71 if (scrollPos.scrollTop != null) updateScrollTop(cm, scrollPos.scrollTop)
72 if (scrollPos.scrollLeft != null) setScrollLeft(cm, scrollPos.scrollLeft)
73}
74
75// Calculate a new scroll position needed to scroll the given
76// rectangle into view. Returns an object with scrollTop and

Callers 1

methods.jsFile · 0.90

Calls 3

calculateScrollPosFunction · 0.70
updateScrollTopFunction · 0.70
setScrollLeftFunction · 0.70

Tested by

no test coverage detected