Index: trunk/parsers/wikidom/lib/es/es.Surface.css |
— | — | @@ -7,19 +7,35 @@ |
8 | 8 | overflow-y: scroll; |
9 | 9 | } |
10 | 10 | |
11 | | -.editSurface-document { |
| 11 | +.editSurface { |
12 | 12 | border: solid 1px silver; |
13 | | - background-color: #dddddd; |
14 | | - cursor: text; |
15 | 13 | margin-left: 12.5%; |
16 | 14 | margin-top: 1em; |
17 | 15 | width: 75%; |
18 | 16 | } |
19 | 17 | |
20 | | -.editSurface-paragraph { |
| 18 | +.editSurface-input { |
| 19 | + position: absolute; |
| 20 | + z-index: -1; |
| 21 | + color: white; |
| 22 | + background-color: white; |
| 23 | + border: none; |
| 24 | +} |
| 25 | + |
| 26 | +.editSurface-input:focus { |
| 27 | + outline: none; |
| 28 | +} |
| 29 | + |
| 30 | +.editSurface-document { |
| 31 | + background-color: #dddddd; |
| 32 | + cursor: text; |
| 33 | + margin-top: 1em; |
| 34 | +} |
| 35 | + |
| 36 | +.editSurface-block { |
21 | 37 | background-color: #eeeeee; |
22 | 38 | margin: 1em; |
23 | | - margin-bottom: 0; |
| 39 | + margin-top: 0; |
24 | 40 | } |
25 | 41 | |
26 | 42 | .editSurface-line { |
Index: trunk/parsers/wikidom/lib/es/es.Surface.js |
— | — | @@ -19,7 +19,7 @@ |
20 | 20 | * @returns {Surface} |
21 | 21 | */ |
22 | 22 | function Surface( $container, document ) { |
23 | | - this.$ = $container; |
| 23 | + this.$ = $container.addClass( 'editSurface' ); |
24 | 24 | this.document = document; |
25 | 25 | this.rendered = false; |
26 | 26 | this.location = null; |
— | — | @@ -51,8 +51,8 @@ |
52 | 52 | this.$.after( this.cursor.$ ); |
53 | 53 | |
54 | 54 | // Hidden input |
55 | | - this.$input = $( '<input/>' ); |
56 | | - this.$.before( this.$input ); |
| 55 | + this.$input = $( '<input class="editSurface-input" />' ); |
| 56 | + this.$.prepend( this.$input ); |
57 | 57 | this.$input.bind({ |
58 | 58 | 'keydown' : function( e ) { |
59 | 59 | return surface.onKeyDown( e ); |
— | — | @@ -105,6 +105,7 @@ |
106 | 106 | cursorPosition = block.flow.getPosition( nearestOffset ); |
107 | 107 | |
108 | 108 | this.cursor.show( cursorPosition, blockPosition ); |
| 109 | + this.$input.css( 'top', cursorPosition.top ); |
109 | 110 | this.location = new Location( block, nearestOffset ); |
110 | 111 | |
111 | 112 | this.state.selection = { |
Index: trunk/parsers/wikidom/lib/es/es.TextFlow.js |
— | — | @@ -163,7 +163,9 @@ |
164 | 164 | if ( this.lines[line].start < offset ) { |
165 | 165 | var $ruler = $( '<div class="editSurface-line"></div>' ).appendTo( this.$ ), |
166 | 166 | ruler = $ruler[0]; |
167 | | - ruler.innerHTML = this.escape( this.lines[line].text.substring( 0, offset - this.lines[line].start ) ); |
| 167 | + ruler.innerHTML = this.escape( |
| 168 | + this.lines[line].text.substring( 0, offset - this.lines[line].start ) |
| 169 | + ); |
168 | 170 | position.left = ruler.clientWidth; |
169 | 171 | $ruler.remove(); |
170 | 172 | } |