| 1080 | } |
| 1081 | |
| 1082 | function scrollEditorIntoView() { |
| 1083 | if (!cursor.getBoundingClientRect) return; |
| 1084 | var rect = cursor.getBoundingClientRect(); |
| 1085 | // IE returns bogus coordinates when the instance sits inside of an iframe and the cursor is hidden |
| 1086 | if (ie && rect.top == rect.bottom) return; |
| 1087 | var winH = window.innerHeight || Math.max(document.body.offsetHeight, document.documentElement.offsetHeight); |
| 1088 | if (rect.top < 0 || rect.bottom > winH) cursor.scrollIntoView(); |
| 1089 | } |
| 1090 | function scrollCursorIntoView() { |
| 1091 | var cursor = localCoords(sel.inverted ? sel.from : sel.to); |
| 1092 | var x = options.lineWrapping ? Math.min(cursor.x, lineSpace.offsetWidth) : cursor.x; |