(cm)
| 4689 | // 'simulates' scrolling that position into view in a cheap way, so |
| 4690 | // that the effect of intermediate scroll commands is not ignored. |
| 4691 | function resolveScrollToPos(cm) { |
| 4692 | var range = cm.curOp.scrollToPos; |
| 4693 | if (range) { |
| 4694 | cm.curOp.scrollToPos = null; |
| 4695 | var from = estimateCoords(cm, range.from), to = estimateCoords(cm, range.to); |
| 4696 | var sPos = calculateScrollPos(cm, Math.min(from.left, to.left), |
| 4697 | Math.min(from.top, to.top) - range.margin, |
| 4698 | Math.max(from.right, to.right), |
| 4699 | Math.max(from.bottom, to.bottom) + range.margin); |
| 4700 | cm.scrollTo(sPos.scrollLeft, sPos.scrollTop); |
| 4701 | } |
| 4702 | } |
| 4703 | |
| 4704 | // API UTILITIES |
| 4705 |
no test coverage detected