Index: trunk/extensions/VisualEditor/modules/es/models/es.DocumentModel.js |
— | — | @@ -429,6 +429,9 @@ |
430 | 430 | } |
431 | 431 | // Structual offsets will have elements on each side |
432 | 432 | if ( data[offset - 1].type !== undefined && data[offset].type !== undefined ) { |
| 433 | + if ( '/' + data[offset - 1].type === data[offset].type ) { |
| 434 | + return false; |
| 435 | + } |
433 | 436 | return true; |
434 | 437 | } |
435 | 438 | return false; |
— | — | @@ -630,9 +633,7 @@ |
631 | 634 | * @param {Integer} Offset a given distance from the given offset |
632 | 635 | */ |
633 | 636 | es.DocumentModel.prototype.getRelativeContentOffset = function( offset, distance ) { |
634 | | - if ( es.DocumentModel.isStructuralOffset( this.data, offset ) ) { |
635 | | - throw 'Invalid offset error. Can not get relative content offset from non-content offset.'; |
636 | | - } |
| 637 | + console.log(offset); |
637 | 638 | if ( distance === 0 ) { |
638 | 639 | return offset; |
639 | 640 | } |