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

Function addToScrollPos

static/mergely/lib/codemirror.js:4667–4673  ·  view source on GitHub ↗
(cm, left, top)

Source from the content-addressed store, hash-verified

4665 // Store a relative adjustment to the scroll position in the current
4666 // operation (to be applied when the operation finishes).
4667 function addToScrollPos(cm, left, top) {
4668 if (left != null || top != null) resolveScrollToPos(cm);
4669 if (left != null)
4670 cm.curOp.scrollLeft = (cm.curOp.scrollLeft == null ? cm.doc.scrollLeft : cm.curOp.scrollLeft) + left;
4671 if (top != null)
4672 cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top;
4673 }
4674
4675 // Make sure that at the end of the operation the current cursor is
4676 // shown.

Callers 3

codemirror.jsFile · 0.70
addLineWidgetFunction · 0.70

Calls 1

resolveScrollToPosFunction · 0.70

Tested by

no test coverage detected