Index: trunk/extensions/VisualEditor/modules/ve/ce/ve.ce.Surface.js |
— | — | @@ -578,8 +578,8 @@ |
579 | 579 | ve.ce.Surface.prototype.getSelectionRect = function() { |
580 | 580 | var rangySel = rangy.getSelection(); |
581 | 581 | return { |
582 | | - start: rangySel.getStartClientPos(), |
583 | | - end: rangySel.getEndClientPos() |
| 582 | + start: rangySel.getStartDocumentPos(), |
| 583 | + end: rangySel.getEndDocumentPos() |
584 | 584 | }; |
585 | 585 | }; |
586 | 586 | |
— | — | @@ -655,6 +655,9 @@ |
656 | 656 | var $node = $( elem ); |
657 | 657 | while( !$node.hasClass( 'ce-leafNode' ) ) { |
658 | 658 | $node = $node.parent(); |
| 659 | + if ( $node.is( 'body') ) { |
| 660 | + return null; |
| 661 | + } |
659 | 662 | } |
660 | 663 | return $node; |
661 | 664 | }; |