small fix: getSelectionRange was breaking the surface layer, changed to saved state member

This commit is contained in:
Rob Moen 2012-03-12 22:04:29 +00:00
parent 65170e13df
commit 22a351e855
Notes: Rob Moen 2012-03-12 22:04:29 +00:00
2 changed files with 1 additions and 4 deletions

View file

@ -150,7 +150,7 @@ ve.ce.Surface.prototype.addInsertionAnnotation = function( annotation ) {
ve.ce.Surface.prototype.loadInsertionAnnotations = function( annotation ) {
this.insertionAnnotations =
this.model.getDocument().getAnnotationsFromOffset( this.getSelectionRange().to - 1 );
this.model.getDocument().getAnnotationsFromOffset( this.currentSelection.to - 1 );
// Filter out annotations that aren't textStyles or links
for ( var i = 0; i < this.insertionAnnotations.length; i++ ) {
if ( !this.insertionAnnotations[i].type.match( /(textStyle\/|link\/)/ ) ) {

View file

@ -95,9 +95,6 @@ ve.ui.Context.prototype.positionIcon = function() {
var selection = this.surfaceView.getModel().getSelection(),
offset;
this.position = null;
console.log( this.surfaceView.getSelectionRect() );
if ( selection.from < selection.to ) {
var $lastRange = this.surfaceView.$.find( '.es-contentView-range:visible:last' );
if ( $lastRange.length ) {