MCPcopy
hub / github.com/nwutils/nw-sample-apps / scrollEditorIntoView

Function scrollEditorIntoView

mini-code-edit/cm/lib/codemirror.js:882–889  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

880 }
881
882 function scrollEditorIntoView() {
883 if (!cursor.getBoundingClientRect) return;
884 var rect = cursor.getBoundingClientRect();
885 // IE returns bogus coordinates when the instance sits inside of an iframe and the cursor is hidden
886 if (ie && rect.top == rect.bottom) return;
887 var winH = window.innerHeight || Math.max(document.body.offsetHeight, document.documentElement.offsetHeight);
888 if (rect.top < 0 || rect.bottom > winH) cursor.scrollIntoView();
889 }
890 function scrollCursorIntoView() {
891 var cursor = localCoords(sel.inverted ? sel.from : sel.to);
892 var x = options.lineWrapping ? Math.min(cursor.x, lineSpace.offsetWidth) : cursor.x;

Callers 1

endOperationFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected