mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-24 22:35:41 +00:00
No more endless looping! And fix getSelectionRect to return document relative coordiantes instead of viewport relative.
This commit is contained in:
parent
cde7a3bf7e
commit
6ef8ac182a
Notes:
Inez Korczynski
2012-03-16 21:52:17 +00:00
|
@ -578,8 +578,8 @@ ve.ce.Surface.prototype.getSelectionRange = function() {
|
|||
ve.ce.Surface.prototype.getSelectionRect = function() {
|
||||
var rangySel = rangy.getSelection();
|
||||
return {
|
||||
start: rangySel.getStartClientPos(),
|
||||
end: rangySel.getEndClientPos()
|
||||
start: rangySel.getStartDocumentPos(),
|
||||
end: rangySel.getEndDocumentPos()
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -655,6 +655,9 @@ ve.ce.Surface.getLeafNode = function( elem ) {
|
|||
var $node = $( elem );
|
||||
while( !$node.hasClass( 'ce-leafNode' ) ) {
|
||||
$node = $node.parent();
|
||||
if ( $node.is( 'body') ) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return $node;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue