mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-24 22:35:41 +00:00
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:
parent
43bce96fae
commit
267ccf9040
|
@ -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() ) {
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue