Index: trunk/parsers/wikidom/lib/es/es.Surface.js |
— | — | @@ -18,12 +18,15 @@ |
19 | 19 | return surface.onMouseDown( e ); |
20 | 20 | } |
21 | 21 | }); |
| 22 | + |
| 23 | + this.$cursor = $( '<div class="editSurface-cursor"></div>' ); |
| 24 | + this.$.after( this.$cursor ); |
22 | 25 | } |
23 | 26 | |
24 | 27 | Surface.prototype.onMouseDown = function( e ) { |
25 | 28 | var $target = $( e.target ); |
26 | | - $block = $target.is( '.editSurface-block' ) ? $target : $target.closest( '.editSurface-block' ), |
27 | | - block = $block.data( 'block' ); |
| 29 | + $block = $target.is( '.editSurface-block' ) ? $target : $target.closest( '.editSurface-block' ), |
| 30 | + block = $block.data( 'block' ); |
28 | 31 | |
29 | 32 | if( !block ) { |
30 | 33 | return false; |
— | — | @@ -42,7 +45,14 @@ |
43 | 46 | */ |
44 | 47 | Surface.prototype.setCursor = function( location ) { |
45 | 48 | this.location = location; |
46 | | - // ... |
| 49 | + |
| 50 | + var position = this.location.block.getPosition( this.location.offset ); |
| 51 | + var offset = this.location.block.$.offset(); |
| 52 | + |
| 53 | + this.$cursor.css({ |
| 54 | + 'left': position.left + offset.left, |
| 55 | + 'top': position.top + offset.top |
| 56 | + }).show(); |
47 | 57 | }; |
48 | 58 | |
49 | 59 | /** |