Put getSelectionRect method back in surface view.

Change-Id: Iaec899bec157ef39810d391b2ed51d4f8fe3be9d
This commit is contained in:
Rob Moen 2012-06-07 14:13:55 -07:00
parent 4b940c3b19
commit 9fe6658a0e

View file

@ -255,7 +255,7 @@ ve.ce.Surface.prototype.onPaste = function( e ) {
ve.ce.Surface.prototype.showCursor = function( offset ) {
this.showSelection( new ve.Range( offset ) );
}
};
ve.ce.Surface.prototype.showSelection = function( range ) {
var rangySel = rangy.getSelection(),
@ -489,6 +489,14 @@ ve.ce.Surface.prototype.getOffsetFromElementNode = function( DOMnode, DOMoffset,
ve.ce.Surface.prototype.getModel = function() {
return this.model;
};
/* Supplies the selection anchor coordinates to contextView */
ve.ce.Surface.prototype.getSelectionRect = function() {
var rangySel = rangy.getSelection();
return {
start: rangySel.getStartDocumentPos(),
end: rangySel.getEndDocumentPos()
};
};
/* Inheritance */