MCPcopy Create free account
hub / github.com/TruthHun/BookStack / scrollIntoView

Function scrollIntoView

static/editor.md/lib/codemirror/lib/codemirror.js:4448–4452  ·  view source on GitHub ↗
(cm, x1, y1, x2, y2)

Source from the content-addressed store, hash-verified

4446
4447 // Scroll a given set of coordinates into view (immediately).
4448 function scrollIntoView(cm, x1, y1, x2, y2) {
4449 var scrollPos = calculateScrollPos(cm, x1, y1, x2, y2);
4450 if (scrollPos.scrollTop != null) setScrollTop(cm, scrollPos.scrollTop);
4451 if (scrollPos.scrollLeft != null) setScrollLeft(cm, scrollPos.scrollLeft);
4452 }
4453
4454 // Calculate a new scroll position needed to scroll the given
4455 // rectangle into view. Returns an object with scrollTop and

Callers 1

codemirror.jsFile · 0.70

Calls 3

calculateScrollPosFunction · 0.70
setScrollTopFunction · 0.70
setScrollLeftFunction · 0.70

Tested by

no test coverage detected