Index: trunk/parsers/wikidom/lib/es/es.Surface.js |
— | — | @@ -15,14 +15,14 @@ |
16 | 16 | this.keyboardSelecting = false; |
17 | 17 | this.keydownTimeout = null; |
18 | 18 | this.initialHorizontalCursorPosition = null; |
19 | | - |
| 19 | + |
20 | 20 | // MouseDown on surface |
21 | 21 | this.$.bind({ |
22 | 22 | 'mousedown' : function(e) { |
23 | 23 | return surface.onMouseDown( e ); |
24 | 24 | } |
25 | 25 | }); |
26 | | - |
| 26 | + |
27 | 27 | // Selection |
28 | 28 | this.$ranges = $( '<div class="editSurface-ranges"></div>' ).prependTo( this.$ ); |
29 | 29 | this.$rangeStart = $( '<div class="editSurface-range"></div>' ).appendTo( this.$ranges ); |
— | — | @@ -61,12 +61,16 @@ |
62 | 62 | }); |
63 | 63 | |
64 | 64 | $(window).resize( function() { |
| 65 | + surface.cursor.hide(); |
65 | 66 | surface.doc.updateBlocks(); |
66 | 67 | } ); |
67 | 68 | |
68 | 69 | this.doc.on( 'update', function() { |
69 | 70 | surface.drawSelection(); |
70 | | - // TODO: Update the cursor position |
| 71 | + if ( surface.location && surface.location.block ) { |
| 72 | + var cursorPosition = surface.location.block.getPosition( surface.location.offset ); |
| 73 | + surface.cursor.show( cursorPosition, surface.location.block.$.offset() ); |
| 74 | + } |
71 | 75 | } ); |
72 | 76 | |
73 | 77 | // First render |