r114034 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r114033‎ | r114034 | r114035 >
Date:21:52, 16 March 2012
Author:inez
Status:deferred
Tags:
Comment:
No more endless looping! And fix getSelectionRect to return document relative coordiantes instead of viewport relative.
Modified paths:
  • /trunk/extensions/VisualEditor/modules/ve/ce/ve.ce.Surface.js (modified) (history)

Diff [purge]

Index: trunk/extensions/VisualEditor/modules/ve/ce/ve.ce.Surface.js
@@ -578,8 +578,8 @@
579579 ve.ce.Surface.prototype.getSelectionRect = function() {
580580 var rangySel = rangy.getSelection();
581581 return {
582 - start: rangySel.getStartClientPos(),
583 - end: rangySel.getEndClientPos()
 582+ start: rangySel.getStartDocumentPos(),
 583+ end: rangySel.getEndDocumentPos()
584584 };
585585 };
586586
@@ -655,6 +655,9 @@
656656 var $node = $( elem );
657657 while( !$node.hasClass( 'ce-leafNode' ) ) {
658658 $node = $node.parent();
 659+ if ( $node.is( 'body') ) {
 660+ return null;
 661+ }
659662 }
660663 return $node;
661664 };

Status & tagging log