Index: trunk/parsers/wikidom/lib/synth/views/es.SurfaceView.js |
— | — | @@ -286,16 +286,22 @@ |
287 | 287 | this.cursor.initialLeft = currentPosition.left; |
288 | 288 | } |
289 | 289 | var fakePosition = new es.Position( this.cursor.initialLeft, currentPosition.top ), |
290 | | - edgeCondition = ( direction == 'up' ) ? 0 : this.documentView.getLength(), |
| 290 | + edgeCondition = ( direction === 'up' ) ? 0 : this.documentView.getLength(), |
291 | 291 | offset, |
292 | 292 | i = 1; |
293 | | - |
294 | 293 | do { |
295 | | - ( direction == 'up' ) ? fakePosition.top -= i++ * 10 : fakePosition.top += i++ * 10; |
| 294 | + if ( direction == 'up' ) { |
| 295 | + fakePosition.top -= i++ * 5; |
| 296 | + } else { |
| 297 | + fakePosition.top += i++ * 5; |
| 298 | + } |
296 | 299 | offset = this.documentView.getOffsetFromPosition( fakePosition ); |
| 300 | + if ( offset === edgeCondition ) { |
| 301 | + return; |
| 302 | + } |
297 | 303 | fakePosition = this.documentView.getRenderedPosition( offset ); |
298 | 304 | fakePosition.left = this.cursor.initialLeft; |
299 | | - } while ( currentPosition.top === fakePosition.top && offset !== edgeCondition ) |
| 305 | + } while ( currentPosition.top === fakePosition.top ); |
300 | 306 | this.showCursor( this.documentView.getOffsetFromPosition( fakePosition ) ); |
301 | 307 | } |
302 | 308 | return; |