Index: trunk/parsers/wikidom/lib/es/es.Surface.js |
— | — | @@ -16,7 +16,7 @@ |
17 | 17 | block = $block.data( 'block' ); |
18 | 18 | var position = new Position(e.pageX - $block.offset().left, e.pageY - $block.offset().top); |
19 | 19 | var offest = block.flow.getOffset( position ); |
20 | | - block.insertContent(offest, '___!___'); |
| 20 | + block.insertContent(offest, '!'); |
21 | 21 | //this.setCursor(new Location(block, offset)) |
22 | 22 | }); |
23 | 23 | } |
Index: trunk/parsers/wikidom/lib/es/es.TextFlow.js |
— | — | @@ -80,9 +80,14 @@ |
81 | 81 | var $ruler = $( '<div class="editSurface-line"></div>' ).appendTo( this.$ ) |
82 | 82 | ruler = $ruler[0], |
83 | 83 | fit = this.fitCharacters( this.lines[line].start, this.lines[line].end, ruler, position.x ); |
| 84 | + ruler.innerHTML = this.escape( this.text.substring( this.lines[line].start, fit.end ) ); |
| 85 | + var left = ruler.clientWidth; |
| 86 | + ruler.innerHTML = this.escape( this.text.substring( this.lines[line].start, fit.end + 1 ) ); |
| 87 | + var right = ruler.clientWidth; |
| 88 | + var center = Math.round( left + ( ( right - left ) / 2 ) ); |
84 | 89 | $ruler.remove(); |
85 | | - |
86 | | - return fit.end; |
| 90 | + console.log(left, center, right, position.x); |
| 91 | + return fit.end + ( position.x >= center ? 1 : 0 ); |
87 | 92 | }; |
88 | 93 | |
89 | 94 | /** |