We're getting there

This commit is contained in:
Garen Torikian 2012-04-21 17:54:46 -07:00
commit 512bde6fd8
51 changed files with 1472 additions and 574 deletions

View file

@ -484,7 +484,7 @@ var VirtualRenderer = function(container, theme) {
/**
* VirtualRenderer.moveTextAreaToCursor(textarea) -> Void
* - textarea (Element): A text area to work with
* - textarea (DOMElement): A text area to work with
*
* Changes the position of `textarea` to where the cursor is pointing.
**/
@ -960,12 +960,19 @@ var VirtualRenderer = function(container, theme) {
* VirtualRenderer.scrollToRow(row) -> Void
* - row (Number): A row id
*
* Sets the top of the editor to the row indicated.
* Gracefully scrolls the top of the editor to the row indicated.
**/
this.scrollToRow = function(row) {
this.session.setScrollTop(row * this.lineHeight);
};
/**
* VirtualRenderer.scrollToLine(line, center) -> Void
* - line (Number): A line number
* - center (Boolean): If `true`, centers the editor the to indicated line
*
* Gracefully scrolls the editor to the row indicated.
**/
this.scrollToLine = function(line, center) {
var pos = this.$cursorLayer.getPixelPosition({row: line, column: 0});
var offset = pos.top;