(cm)
| 3576 | // 'simulates' scrolling that position into view in a cheap way, so |
| 3577 | // that the effect of intermediate scroll commands is not ignored. |
| 3578 | function resolveScrollToPos(cm) { |
| 3579 | var range = cm.curOp.scrollToPos; |
| 3580 | if (range) { |
| 3581 | cm.curOp.scrollToPos = null; |
| 3582 | var from = estimateCoords(cm, range.from), to = estimateCoords(cm, range.to); |
| 3583 | var sPos = calculateScrollPos(cm, Math.min(from.left, to.left), |
| 3584 | Math.min(from.top, to.top) - range.margin, |
| 3585 | Math.max(from.right, to.right), |
| 3586 | Math.max(from.bottom, to.bottom) + range.margin); |
| 3587 | cm.scrollTo(sPos.scrollLeft, sPos.scrollTop); |
| 3588 | } |
| 3589 | } |
| 3590 | |
| 3591 | // API UTILITIES |
| 3592 |
no test coverage detected