All pastes #2092328 Raw Edit

Stuff

public javascript v1 · immutable
#2092328 ·published 2011-10-21 20:33 UTC
rendered paste body
	} else if ( direction === 'up' || direction === 'down' ) {		var currentPosition = this.documentView.getRenderedPosition( this.cursor.offset );		if ( this.cursor.initialLeft === null ) {			this.cursor.initialLeft = currentPosition.left;		}		var	fakePosition = new es.Position( this.cursor.initialLeft, currentPosition.top ),			edgeCondition = ( direction === 'up' ) ? 0 : this.documentView.getLength(),			offset,			i = 1;		do {			if ( direction == 'up' ) {				fakePosition.top -= i++ * 5;			} else {				fakePosition.top += i++ * 5;			}			offset = this.documentView.getOffsetFromPosition( fakePosition );			if ( offset === edgeCondition ) {				return;			}			fakePosition = this.documentView.getRenderedPosition( offset );			fakePosition.left = this.cursor.initialLeft;		} while ( currentPosition.top === fakePosition.top );		this.showCursor( this.documentView.getOffsetFromPosition( fakePosition ) );	}