| 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; |