mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-28 16:20:52 +00:00
small fix: getSelectionRange was breaking the surface layer, changed to saved state member
This commit is contained in:
parent
65170e13df
commit
22a351e855
Notes:
Rob Moen
2012-03-12 22:04:29 +00:00
|
@ -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\/)/ ) ) {
|
||||
|
|
|
@ -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 ) {
|
||||
|
|
Loading…
Reference in a new issue