mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 02:23:58 +00:00
Put getSelectionRect method back in surface view.
Change-Id: Iaec899bec157ef39810d391b2ed51d4f8fe3be9d
This commit is contained in:
parent
4b940c3b19
commit
9fe6658a0e
|
@ -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 */
|
||||
|
||||
|
|
Loading…
Reference in a new issue