Index: trunk/parsers/wikidom/lib/hype/views/es.ContentView.js |
— | — | @@ -271,6 +271,22 @@ |
272 | 272 | }; |
273 | 273 | |
274 | 274 | /** |
| 275 | + * Gets the range of the rendered line a given offset is within. |
| 276 | + * |
| 277 | + * @method |
| 278 | + * @param {Integer} offset Offset to get line for |
| 279 | + * @returns {Range} |
| 280 | + */ |
| 281 | +es.ContentView.prototype.getRenderedLineRange = function( offset ) { |
| 282 | + for ( var i = 0; i < this.lines.length; i++ ) { |
| 283 | + if ( this.lines[i].range.containsOffset( offset ) ) { |
| 284 | + return this.lines[i].range; |
| 285 | + } |
| 286 | + } |
| 287 | + return null; |
| 288 | +}; |
| 289 | + |
| 290 | +/** |
275 | 291 | * Gets offset within content model closest to of a given position. |
276 | 292 | * |
277 | 293 | * Position is assumed to be local to the container the text is being flowed in. |