MCPcopy Create free account
hub / github.com/breck7/scroll / scrollIntoView

Function scrollIntoView

external/.scrollLibs.js:4917–4925  ·  view source on GitHub ↗
(cm, rect)

Source from the content-addressed store, hash-verified

4915
4916 // Scroll a given set of coordinates into view (immediately).
4917 function scrollIntoView(cm, rect) {
4918 var scrollPos = calculateScrollPos(cm, rect)
4919 if (scrollPos.scrollTop != null) {
4920 updateScrollTop(cm, scrollPos.scrollTop)
4921 }
4922 if (scrollPos.scrollLeft != null) {
4923 setScrollLeft(cm, scrollPos.scrollLeft)
4924 }
4925 }
4926
4927 // Calculate a new scroll position needed to scroll the given
4928 // rectangle into view. Returns an object with scrollTop and

Callers 1

addEditorMethodsFunction · 0.85

Calls 3

calculateScrollPosFunction · 0.85
updateScrollTopFunction · 0.85
setScrollLeftFunction · 0.85

Tested by

no test coverage detected