Index: trunk/parsers/wikidom/lib/synth/views/es.ListBlockItemView.js |
— | — | @@ -76,7 +76,12 @@ |
77 | 77 | * @returns {es.Position} Position of offset |
78 | 78 | */ |
79 | 79 | es.ListBlockItemView.prototype.getRenderedPosition = function( offset ) { |
80 | | - return this.contentView.getPosition( position ); |
| 80 | + var position = this.contentView.getPosition( offset ), |
| 81 | + offset = this.$content.offset(); |
| 82 | + position.top += offset.top; |
| 83 | + position.left += offset.left; |
| 84 | + position.bottom += offset.top; |
| 85 | + return position; |
81 | 86 | }; |
82 | 87 | |
83 | 88 | /** |
Index: trunk/parsers/wikidom/lib/synth/views/es.ListBlockView.js |
— | — | @@ -94,7 +94,11 @@ |
95 | 95 | * @returns {es.Position} Position of offset |
96 | 96 | */ |
97 | 97 | es.ListBlockView.prototype.getRenderedPosition = function( offset ) { |
98 | | - // TODO |
| 98 | + var item = this.items.lookup( offset ); |
| 99 | + if ( item !== null ) { |
| 100 | + return item.getRenderedPosition( offset - this.items.offsetOf( item ) ); |
| 101 | + } |
| 102 | + return null; |
99 | 103 | }; |
100 | 104 | |
101 | 105 | /** |
Index: trunk/parsers/wikidom/lib/synth/views/es.HeadingBlockView.js |
— | — | @@ -40,7 +40,6 @@ |
41 | 41 | es.HeadingBlockView.prototype.getRenderedPosition = function( offset ) { |
42 | 42 | var position = this.contentView.getPosition( offset ), |
43 | 43 | offset = this.$.offset(); |
44 | | - |
45 | 44 | position.top += offset.top; |
46 | 45 | position.left += offset.left; |
47 | 46 | position.bottom += offset.top; |
Index: trunk/parsers/wikidom/lib/synth/views/es.TableBlockRowView.js |
— | — | @@ -90,7 +90,11 @@ |
91 | 91 | * @returns {es.Position} Position of offset |
92 | 92 | */ |
93 | 93 | es.TableBlockRowView.prototype.getRenderedPosition = function( offset ) { |
94 | | - // TODO |
| 94 | + var item = this.items.lookup( offset ); |
| 95 | + if ( item !== null ) { |
| 96 | + return item.getRenderedPosition( offset - this.items.offsetOf( item ) ); |
| 97 | + } |
| 98 | + return null; |
95 | 99 | }; |
96 | 100 | |
97 | 101 | /** |
Index: trunk/parsers/wikidom/lib/synth/views/es.ParagraphBlockView.js |
— | — | @@ -69,7 +69,12 @@ |
70 | 70 | * @returns {es.Position} Position of offset |
71 | 71 | */ |
72 | 72 | es.ParagraphBlockView.prototype.getRenderedPosition = function( offset ) { |
73 | | - return this.contentView.getPosition( position ); |
| 73 | + var position = this.contentView.getPosition( offset ), |
| 74 | + offset = this.$.offset(); |
| 75 | + position.top += offset.top; |
| 76 | + position.left += offset.left; |
| 77 | + position.bottom += offset.top; |
| 78 | + return position; |
74 | 79 | }; |
75 | 80 | |
76 | 81 | /** |
Index: trunk/parsers/wikidom/lib/synth/views/es.TableBlockCellView.js |
— | — | @@ -89,7 +89,11 @@ |
90 | 90 | * @returns {es.Position} Position of offset |
91 | 91 | */ |
92 | 92 | es.TableBlockCellView.prototype.getRenderedPosition = function( offset ) { |
93 | | - // TODO |
| 93 | + var item = this.items.lookup( offset ); |
| 94 | + if ( item !== null ) { |
| 95 | + return item.getRenderedPosition( offset - this.items.offsetOf( item ) ); |
| 96 | + } |
| 97 | + return null; |
94 | 98 | }; |
95 | 99 | |
96 | 100 | /** |
Index: trunk/parsers/wikidom/lib/synth/views/es.TableBlockView.js |
— | — | @@ -91,7 +91,11 @@ |
92 | 92 | * @returns {es.Position} Position of offset |
93 | 93 | */ |
94 | 94 | es.TableBlockView.prototype.getRenderedPosition = function( offset ) { |
95 | | - // TODO |
| 95 | + var item = this.items.lookup( offset ); |
| 96 | + if ( item !== null ) { |
| 97 | + return item.getRenderedPosition( offset - this.items.offsetOf( item ) ); |
| 98 | + } |
| 99 | + return null; |
96 | 100 | }; |
97 | 101 | |
98 | 102 | /** |