Index: trunk/parsers/wikidom/lib/es/es.ListBlockItem.js |
— | — | @@ -16,11 +16,20 @@ |
17 | 17 | es.ListBlockItem = function( content, lists ) { |
18 | 18 | es.EventEmitter.call( this ); |
19 | 19 | es.Container.call( this, 'item', 'lists', lists, 'li' ); |
| 20 | + |
20 | 21 | this.content = content || new es.Content(); |
| 22 | + this.$content = $( '<div class="editSurface-list-content"></div>' ); |
| 23 | + this.$.prepend( this.$content ); |
| 24 | + this.flow = new es.TextFlow( this.$content, this.content ); |
| 25 | + |
| 26 | + /* |
| 27 | + this.content = content || new es.Content(); |
21 | 28 | this.$line = $( '<div class="editSurface-list-line"></div>' ); |
22 | 29 | this.$content = $( '<div class="editSurface-list-content"></div>' ); |
23 | 30 | this.$.prepend( this.$line.append( this.$content ) ); |
24 | 31 | this.flow = new es.TextFlow( this.$content, this.content ); |
| 32 | + */ |
| 33 | + |
25 | 34 | var listBlockItem = this; |
26 | 35 | this.flow.on( 'render', function() { |
27 | 36 | listBlockItem.emit( 'update' ); |
— | — | @@ -119,7 +128,7 @@ |
120 | 129 | globalOffset = null; |
121 | 130 | |
122 | 131 | if ( position.top >= itemOffset.top && position.top < itemOffset.top + itemHeight ) { |
123 | | - if ( position.top < itemOffset.top + this.$line.height() ) { |
| 132 | + if ( position.top < itemOffset.top + this.$content.height() ) { |
124 | 133 | position.top -= itemOffset.top; |
125 | 134 | position.left -= itemOffset.left; |
126 | 135 | return globalOffset + this.flow.getOffset( position ); |
Index: trunk/parsers/wikidom/lib/es/es.ListBlock.js |
— | — | @@ -194,7 +194,7 @@ |
195 | 195 | var location = this.list.getLocationFromOffset( offset ) |
196 | 196 | position = location.item.flow.getPosition( location.offset ), |
197 | 197 | blockOffset = this.$.offset(), |
198 | | - lineOffset = location.item.$line.find( '.editSurface-list-content' ).offset(); |
| 198 | + lineOffset = location.item.$content.offset(); |
199 | 199 | |
200 | 200 | position.top += lineOffset.top - blockOffset.top; |
201 | 201 | position.left += lineOffset.left - blockOffset.left; |