Compare annotations by name only when clearing/toggling

Otherwise links don't get removed as an empty link is not
comparable to a real link with an href.

Bug: 50461
Change-Id: Id8b421bd44cd5c427d0e5cd738c380bc2b1ea719
This commit is contained in:
Ed Sanders 2013-07-16 00:05:11 +01:00
parent 43bce96fae
commit 267ccf9040
2 changed files with 2 additions and 2 deletions

View file

@ -520,7 +520,7 @@ ve.dm.SurfaceFragment.prototype.annotateContent = function ( method, nameOrAnnot
annotations = [ annotation ];
} else {
annotations = this.document.data.getAnnotationsFromRange( this.getRange(), true )
.getComparableAnnotations( annotation ).get();
.getAnnotationsByName( annotation.name ).get();
}
}
if ( this.getRange( true ).getLength() ) {

View file

@ -78,7 +78,7 @@ ve.ui.AnnotationAction.prototype.toggle = function ( name, data ) {
);
} else {
existingAnnotations = surfaceModel
.getInsertionAnnotations().getComparableAnnotations( annotation );
.getInsertionAnnotations().getAnnotationsByName( annotation.name );
if ( existingAnnotations.isEmpty() ) {
surfaceModel.addInsertionAnnotations( annotation );
} else {