(cm)
| 4712 | // 'simulates' scrolling that position into view in a cheap way, so |
| 4713 | // that the effect of intermediate scroll commands is not ignored. |
| 4714 | function resolveScrollToPos(cm) { |
| 4715 | var range = cm.curOp.scrollToPos; |
| 4716 | if (range) { |
| 4717 | cm.curOp.scrollToPos = null; |
| 4718 | var from = estimateCoords(cm, range.from), to = estimateCoords(cm, range.to); |
| 4719 | var sPos = calculateScrollPos(cm, Math.min(from.left, to.left), |
| 4720 | Math.min(from.top, to.top) - range.margin, |
| 4721 | Math.max(from.right, to.right), |
| 4722 | Math.max(from.bottom, to.bottom) + range.margin); |
| 4723 | cm.scrollTo(sPos.scrollLeft, sPos.scrollTop); |
| 4724 | } |
| 4725 | } |
| 4726 | |
| 4727 | // API UTILITIES |
| 4728 |
no test coverage detected